Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def checkIfExist(self, arr: List[int]) -> bool:
- hashmap = {}
- for ind, num in enumerate(arr):
- hashmap[num] = ind
- for i in range(len(arr)):
- if 2*arr[i] in hashmap and hashmap[2*arr[i]] != i:
- return True
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement