Swiggy interview question

How to find if it's Anagram string

Interview Answer

Anonymous

26 Oct 2017

Solution 1 1.Create a dictionary with character as key and count as value 2.Match both Note: interviewer said not to use extra space but this had Time complexity of n Solution 2 1. Sort 2. Compare each item Note. Time complexity was nlogn assuming we used merge sort. But here interviewer said time complexity is more.