Search
⌘K

Leetcode 1426. Counting Elements

Given an integer array, count how many elements x have x+1 also present in the array (count duplicates separately). Use a hash set or frequency map to check successors efficiently.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

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