Contains Duplicate (easy)
Given an integer array
true if any value appears at least twice in the array, and return
false if every element is distinct.
Input: nums= [1, 2, 3, 4] Output: false Explanation: There are no duplicates in the given array.
Input: nums= [1, 2, 3, 1] Output: true Explanation: '1' is repeating.
Try it yourself
Try solving this question here:
For a detailed solution, see the next chapter.