Check if two strings are permutations of each other
Anonymous
If arrayA length arrayB length return False Create fixed integer array size of 256 (to be used as hash table) // Fixed sized array considered O(1) Zero the array For string A increment hash[array_A[i]] For string B if hash[array_B[i]] > 0 decrement hash[array[i]] else return False If any hash[i] > 0 return False return True
Check out your Company Bowl for anonymous work chats.