Leetcode 2784. Check if Array is Good
Determine whether nums is a permutation of base[n] = [1,2,...,n,n] where n is the array's maximum. Equivalently, check that len(nums) == n+1 and numbers 1..n-1 each appear once while n appears twice (and no other values occur).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.