Solution for Two Sum problem which is a part of Grind 75 list.
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
mapping = {}
for idx, val in enumerate(nums):
req = target-val
if req in mapping:
return [mapping[req], idx]
mapping[val] = idx
return []