You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 lines
167 B
Ruby

# returns true if string1 and string2 are permutations of each other
def check_permutations(string1, string2)
string1.chars.sort.join == string2.chars.sort.join
end