Free written solutionCheck if Array is Good (LeetCode 2784): Solution and Explanation
Decide whether an array is a reordering of base[n] = [1, 2, ..., n-1, n, n], the array that holds 1 to n-1 once each and n twice.
Read the intuition, approach, code and complexity →