Leetcode Counting Elements In A String