""" Largest Unique Number Given an integer array nums, return the largest integer that occurs exactly once. If no integer occurs once, return -1. Example 1 Input: nums = [5, 7, 3, 9, 4, 9, 8, 3, 1] Output: 8 Explanation: The maximum value 9 appears more than once. The largest value that appears exactly once is 8. Example 2 Input: nums = [9, 9, 8, 8] Output: -1 Explanation: No number appears exactly once. Constraints 1 <= len(nums) <= 2000 0 <= nums[i] <= 1000 Expected Complexity Time O(n) Space O(n) """ def solution(nums): pass print("Largest Unique Number", end=" ") assert solution([5, 7, 3, 9, 4, 9, 8, 3, 1]) == 8, "example 1 failed" assert solution([9, 9, 8, 8]) == -1, "example 2 failed" assert solution([42]) == 42, "single element failed" assert solution([1, 2, 2, 3, 3, 4]) == 4, "largest unique selection failed" print("OK")