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.
If you mean the alphabetical order of stock names, they are irrelevant here.
The task asks only to compute the final
buy
andsell
values, and mark any badly formatted stocks.This comment is hidden because it contains spoiler information about the solution
The restrictins in Python are ridiculous and don't allow for much variety in or elegant solutions.
I had a very similar error. I submitted again without changing any of my code and it accepted. It seems like the tests are not consistent
This comment is hidden because it contains spoiler information about the solution
me too
Replace f' formatting with .format()
This comment is hidden because it contains spoiler information about the solution
What do you mean? There's an explicit nested loop, and an implicit nested loop here.
I believe the kata is specifically trying to prevent solutions that count, requiring you to find an O(1) solution by seeing a pattern.
;p
yes, it's better practice to use a tuple. And it's precisely because a tuple cannot generate side effects, that it's better to use it than a list.... x)
There are many, many ways to solve this kata, algorithmically speaking. It is of course not unreasonable to set the rank according to the easiest possibility, and according to the cleanest possible implementation.
That said, I don't think it would have been unreasonable to rank this as a
6
. But that's not up to me. And yes, in general, kata rank is deflating. Whether you agree with it or not, it is what it is.Sorry, I found my solution wrong - there exists an array returned when N = 25, not null!
Of course I won't fail in both cases - could you please check through the test in python version? If you check it then you will know what I meant...
Loading more items...