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 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')
.Notification: see the previous message.
This comment is hidden because it contains spoiler information about the solution
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 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 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
yeah, me too.