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.
You iterate n times again with reduce to insert it into an object literal, how does it make logn?? it seems it is O(n) -- O(n)+O(n)+O(n)
May you explain why it is O(nlogn), not very experienced about big o notation
You are correct about
re.findall
.re.match
matches a regex at the beginning of string. In your case, it will succeed since there is a match at the beginning. But, for example, the following match will fail:re.match('(?=a)', 'wass')
.This comment is hidden because it contains spoiler information about the solution
Notification: see the previous message.
im new to regex
Therefore, I didn't understand how this code works; it is positive lookahead, but how it functions and why is there .*{x}
may you help me your highness
Figuring this out is part of the "fun". However, I'd start with the first input that you failed on. Add a print statement in your next_smaller implementation to find the first input you are failing on. Then add a test for that in the tests-window and revise your algorithm until you get the that test to pass. It's likely that once you fix that problem that the rest of the tests will pass.
Well... coding be hard sometimes.
Actually you probably need O(1) so that means no loops!
I could not do it , you mean just 1 loop by saying O(n) right.
so that's why it's 1074 instead of 1064 huh
I haven't solved it sadly. But given that the inputs are so large, you will need a O(n) solution. So make a spreadsheet of inputs and outputs and look for a pattern: there must be one!
i thought memoized function would handle that ,but nah dictionary has a limit.
I'm struggling with this for 5 hours in Python and I give up, I don't get why it doesn't work with huge strings?!
after this conversation I decided to attempt https://www.codewars.com/kata/5ae64f28d2ee274164000118 ,but unfortunately it works,yet it times out. Any clue that u may want to give me if you have done that?
I detrats yb gnidnif eht lacitamehtam .nrettap nehT I desnednoc ti otni eno enil htiw lacigol .srotarepo nehT decalper eht srotarepo htiw esiwtib .seno ehT dne tcudopr si ytelelpmoc elbisneherpmocni
Loading more items...