3 ms·
Remembering the standard library isn't the competency being tested for, but rather the soundness of your solution. Your first solution has two problems from an
by philwelch 13y ago
Remembering the standard library isn't the competency being tested for, but rather the soundness of your solution. Your first solution has two problems from an interview-question standpoint: first, it's incorrect (it misses the case where two words use all the same letters but aren't anagrams, like "banana" and "nab"), and second, you're looping through each character of the second string for each character of the first string so it's a slow algorithm. I would probably try and get you to figure these out with probing questions, but the expectation is that you can figure it out and fix it.