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.
This is not the most optimized solution, given the constraints of the problem.
LinkedList remove funtion will traverse the entire list with each call, which is really not needed. Use of an array of size 26 will ensure constant space complexity (as we are not growing linearly) and constant time reach to each character's count (eliminating need for HashMap or something similar).
You can refer to my solution for comparison. If I am missing some advantage you gain by using linked list, please do reply. I'd love to know! :)