This solution is very idomatic and easily read. So it deserves it's spot at the top.
Your solution has a hidden assumed limit and a bug on the ammount of any specific symbol appearing in the string.
If s1 contains MAX_INT or more appearances of a single character your solution starts returning the wrong output.
This solution is very idomatic and easily read. So it deserves it's spot at the top.
Your solution has a hidden assumed limit and a bug on the ammount of any specific symbol appearing in the string.
If s1 contains MAX_INT or more appearances of a single character your solution starts returning the wrong output.