Search
⌘K

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.

Comments

Your account is free and you can post anonymously if you choose.