Could anyone explain and simply this ? | Sololearn: Learn to code for FREE!

0

Could anyone explain and simply this ?

https://code.sololearn.com/cLA1pcYQjI5y/?ref=app

1/10/2018 4:00:54 PM

Suraj

1 Answer

New Answer

+3

two strings are anagrams if and only if they contain the same set of characters a smart way to determine it is to sort the letters in both strings and compare the arrays - that's what the code does peek and keep are anagrams, beacuse they both are in sorted order "eekp" since the case of letters does not matter it's converted to lower case