Given an integer array nums, return true if any value appears at least twice in the array.
Input: nums = [1,2,3,1]
Output: true
Topics: arrays, hash-map
Asked by: Amazon, Google, Meta, Microsoft, Apple
Time complexity: O(n). Space complexity: O(n).