You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Given an array of integers, a, count the number of pairs of i and j such that a[i] and a[j] are digit anagrams.
// idea: for each integer, make it to charArray and sort it, and store them in hashmap, for every key that its corresponding value larger than 1(means have anagrams), the pair for this key is (v*(v-1))/2