Solution
Link to Github
Link to Github
1 2 3 4 5 6 7 8 9 10 11 | def twosum(num,target): if(len(num)<=1): return dic ={} for i in range(len(num)): if(num[i] in dic): return [dic[num[i]],i] else: dic[target -num[i]] = i num=[2,7,11,15] twosum(num,9) |
No comments:
Post a Comment