You are viewing a single comment's thread. Return to all comments →
Ok, this works, but why does it only work when you loop through "a" first and then "b"?
Can't this be optimized to have one loop and increment/decrement based on the position of "a" and "b" at the same time?
Seems like cookies are disabled on this browser, please enable them to open this website
Strings: Making Anagrams
You are viewing a single comment's thread. Return to all comments →
Ok, this works, but why does it only work when you loop through "a" first and then "b"?
Can't this be optimized to have one loop and increment/decrement based on the position of "a" and "b" at the same time?