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.
I thought that my solution which finds next_num(4028521680729008280092) is 5672520000485856186064 is quite optimal, its uses only about 78204 internal cycles (gap between polydivisible numbers is 1_643_998_319_756_847_905_972). But this is not enough.
PS. It turns out to be enough, but in the description it is written that there is a limited number of them, and after the last one in the test, my algorithm falls into an infinite loop.
PPS. I will not hide this hint under a spoiler, because I do not reveal the algorithm itself, but maybe I will save someone a lot of nerves and time.
when it seems you are doing the right thing and tests says no.
then you make such hard code
and the tests say that they don't care what you return.
Python translation
Python translation
Python translation
I don't know if it is possible in python not to create an instance of the class or the class itself to be able to address its attributes.
therefore, you have to make the NumClass itself, and in the tests create instance Num = NumClass(), on which the tests are made.
It is also possible to discuss the need to implement dunder methods for comparison (equality), arithmetic. because it wasn't in the original kata.
wow!
I upvoted this as best pratices, but not because I think it's a best practice, but so that more people will see it.
Double check your code.
I had false answer for this case too. Only because I compare correct addendums of checksum I found typo error in my code.
I spent some time to detect both growing (increasing) and falling (descending) arithmetic progressions to comply with the rule 1.
But then spent more time to understand what needs to be detected only increasing (growing) arithmetic progression.
When I looked at the name of this kata, I thought that I would have to calculate the difference between bit arrays, not whole characters.
I think that the tests should have cases where the initial shift has such a value (near 26), that if you add the number of words, the result exceeds 26.
python random tests have
\n
endings, sample tests doesn`t.This comment is hidden because it contains spoiler information about the solution
Author's python solution assume that arguments from diapason 84600 - 86399 (23 hours 30 minutes 00 seconds - 23 hours 59 minutes 59 seconds) must to return '0 days ago'
This comment is hidden because it contains spoiler information about the solution
Loading more items...