We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You can also optimize space by using a single array to count the char frequencies. Just add 1 for a and subtract 1 for b, then check if everything is at 0;
Sherlock and Anagrams
You are viewing a single comment's thread. Return to all comments →
You can also optimize space by using a single array to count the char frequencies. Just add 1 for a and subtract 1 for b, then check if everything is at 0;