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.
Incorrect large number calculation was my problem too. But when I found the solution, I was surprised how simple it was.
Anyone came up with a working solution for this? I'm also puzzled as to why the formula works for smaller numbers, but doesn't work for the big ones.
Even when specifying int. I also found that the formula breaks at exactly 16th digit. I.E. the first 16 digits are always correct.
EDIT: I finally have an answer. The thing is, even when I specify int(), python still converts to float when dividing. Naturally, changing all divisions to floor divisions (//) solved the problem.
This comment is hidden because it contains spoiler information about the solution
Hello, all, I had this problem too. Even with a formula and after I forced it to be written with integers...
170970902404966449586247098818855152577703936966215095276168985530690669141903684897 should equal 170970902404966462328920047488181969596690166234976092377640121561715772973645152611
I really have no idea what happened and what I can do.
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
I've tested 2 solutions and it work so I guess the code you made is a bit sub-optimal or run in loop.
I have tried everything I could, but it always times out.
I think they are just too strict on time limit in this kata.
Even I'm getting the same thing as yours.
Did you solve it?
Thanks for that insight. I mistakenly believed that math.floor and math.ceil would return integers.
IshaanKapoor x3
Sizes ranging from 5 to 10 are given as examples. My formula works for all of those sizes and even numbers that are considerably larger. But when it gets to the crazy large numbers, suddenly the formula doesn't fit. I don't understand how the formula stops working above some unknown threshold size. Maybe it's something about enormous spiral sizes that I don't know.
ishaanKapoor x2
It's much easier than you think. Just observe the pattern!
I solved the problem in the following ways in the given order:
I feel like giving up now
I have the same problem, the 2nd one ['e', 'w', 'e', 'w', 'e', 's', 'n', 's', 'e', 'w'] should be correct but it says False, Why is it so, any Idea??