<jupyter_start><jupyter_text>https://leetcode.com/problems/two-sum/<jupyter_code>nums = [3,2,4]
target = 6
def twoSum(nums,target):
    indicies = []
    for i in nums:
        print('i:',i)
        op1,op2,condition = summing(i)
        print(op1,op2,condition)
        if condition:
            return (nums.index(op1),nums.index(op2))
            
def summing(number):
    modified = [i for i in nums if i!=number]
    print(modified)
    for j in modified:
        print('j:',j)
        if j+number==target:
            return j,number,True
    return 0,0,False
twoSum(nums,target)<jupyter_output>i: 3
[2, 4]
j: 2
j: 4
0 0 False
i: 2
[3, 4]
j: 3
j: 4
4 2 True<jupyter_text>Hashmap Solution (better)<jupyter_code>def hashmapSolution(nums,target):
    hashmap = {}
    for i in range(len(nums)):
        hashmap[nums[i]] = i
    for i in range(len(nums)):
        complement = target-nums[i]
        if complement in hashmap and hashmap[complement]!=i:
            return (i,hashmap[complement])
hashmapSolution(nums,target)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13636363636363635, 'fraction_numerical': 0.02462121212121212, 'mean_word_length': 2.9886792452830186, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '120356', 'license': 'MIT', 'n_tokens_mistral': 422, 'n_tokens_neox': 402, 'n_words': 88, 'path': '1. Two Sum.ipynb', 'repo_name': 'SurajpratapsinghSayar/LeetCode-Solutions', 'size': '1056'}