You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**219: Contains Duplicate II-** Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at most k.
33
34
Thoughts:
34
35
Use a dictionary to store each integer and its index in nums as key, value pairs.
@@ -50,6 +51,7 @@ Thoughts: Using a dictionary (hash), insert each sorted string into the dictiona
0 commit comments