- or download this
sub two_sum_choroba {
my ($input, $target) = @_;
...
$seen{$x} = $i;
}
}
- 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.
- 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