Explain the time and space complexity of your solution.
Analyze the provided duplicate-detection solution and justify both complexities in terms of the input length. State any assumptions about dictionary operations.
Function: has_duplicate(nums) accepts a list of integers and returns True if any value appears more than once, otherwise False.
Examples: has_duplicate([4, 1, 4]) returns True; has_duplicate([1, 2, 3]) returns False.
def has_duplicate(nums):