Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
In your code, at each iteration, if a character is found in a str1, a new string is created. It turns out that in the worst case you will get str1.length rows in memory
I compared some of the solutions here with the Stopwatch and it's only executing about 15% slower than the fastest one. Saying that this is "very inefficient" or "long non-efficient" is definitively an overstatement.
Wrong, since input charset is fixed and hence a constant. It's still
O(n^2)
though ;-)