That will also work but the complexity will be higher in general. O(nlogn) vs O(n) using this approach and you will be asked how you can improve it from the interviewer lol.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why not just sort the two strings and check if they are equal?
That will also work but the complexity will be higher in general.
O(nlogn)
vsO(n)
using this approach and you will be asked how you can improve it from the interviewer lol.