Leetcode Counting Elements