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.
Thanks for saying why it works.
This comment is hidden because it contains spoiler information about the solution
the fun fact, is you used the same exact code as mine... even the name of vars xD or the structer, I really find it strage we both used it this way
exactly, if not zero it is false? while if S1 is larger it should be true
because it means it contianed all the letters required and more
that difference would be negative, thus not equal to zero
so I am a little bit confused, what if s1 has more length, more letter for each alphabet, it should not be 0?
My solution was very similar, and honestly I smacked my head when I realized I could have just used sets.
This comment is hidden because it contains spoiler information about the solution
I forgot to say why I assumed the other solutions as 2n,
well because they compare on every iteration both elements
(to make you realize how bad is it, just assume the array is sorted try 10 numbers array)
see how many swaps and how many comparisons for such algorithm
to build an intuition on how bad it is.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
if list are worse then I may suggest sets?
and btw, the idea I meant wasn't about dict or list more than about why counting frequencies of words when all we need to do is terminating when the first repeatition occurs.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
List
is the worst option...Loading more items...