Hash what, lol ? :)))
You simply need to alphabetically sort characters in strings and then compare the result.
3
Sigiloso
24 de set. de 2012
think about the time complexity. Whats the time complexity of the sorting? NlogN
And when using hash mapping, it can be only N. Mapping the string to an alphabet array, the index is the char and the value stores the frequency of the char. Hope it helps.
3
Sigiloso
7 de abr. de 2015
Just reverse one string and then compare the result with other string.
Sigiloso
29 de jul. de 2012
hash
Sigiloso
2 de out. de 2012
easiest way probably to reduce the characters to ascii, add them all together. If values are equal, they all contain the same characters. O(n)