Fidelity Investments interview question

Java DSA on anagram arrays question