Leetcode 1051. Height Checker
Count how many indices in the given heights array differ from the array sorted in non-decreasing order (the expected lineup). Values are small (1–100), so you can simply sort or use a counting-sort style frequency scan to compute mismatches efficiently.
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.