Help for this page

Select Code to Download


  1. or download this
    sub two_sum_choroba {
        my ($input, $target) = @_;
    ...
            $seen{$x} = $i;
        }
    }
    
  2. or download this
    Runtime: 48 ms, faster than 99.40% of Python3 online submissions for T
    +wo Sum.
    Memory Usage: 15.4 MB, less than 42.44% of Python3 online submissions 
    +for Two Sum.
    
  3. or download this
    class Solution:
        def twoSum(self, nums: List[int], target: int) -> List[int]:
    ...
                if target - x in seen:
                    return [i, seen[target - x]]
                seen[x] = i