I\'m trying to compare two strings to see if they are anagrams.
My problem is that I\'m only comparing the first letter in each string. For example, \"Mary\" and \"
First of all, you can do the length check before the for loop, no need to do it for each character...
Also, "break" breaks the whole for loop. If you use "continue" instead of "break", it skips the current step. That is why only the first letters are compared, after the first one it quits the for loop.
I hope this helps you.