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.
That's theory on complexity and if we follow, we should say that what you propose is O(n*m) where m is the number of letters a-z i.e. the size of your boolean array. Now, the log(n) part is less than that for even the largest possible memory of a single computer. And while I agree that m can be considered constant, the O(nlogn) solution will be faster in any practical application. That's theory. And when it comes to other things like readability, then, well the code speaks for itself :)
Nevertheless, you come through array for 3 times (2 foreach, 1 for), while solution on the top goes twice. But your idea is pretty interesting.
Being strict, for very long strings this will take O(nlogn); I've used an array of booleans and I set an element to true if its character is found. At the end my solution is O(n). Please take a look at let me know what you think :)