Leetcode Anagram Questions Java