codebytes: Given two strings, write a method to decide if one is a permutation of the other. [Java]
Q. Given two strings, write a method to decide if one is a permutation of the other.Algorithm:
1. Return false if strings have different lengths.
2. Count the frequency of occurrence of each character in string 1.
3. Match it with the frequency in string 2.
4. If each character has occurred the same number of times in both strings, return true else return false.
Read full article from codebytes: Given two strings, write a method to decide if one is a permutation of the other. [Java]