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.
Yes you're right. I just get this error when I print the larger int values. I guess the ints get converted to strings first, and there's a limit on string lengths.
"ValueError: Exceeds the limit (4300) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit"
See above, this occurs when you print the integer value.
In particular I don't think you can solve the problem without a call to this:
sys.set_int_max_str_digits()
Did you ban
sys
? It's needed for large ints in Python.Oh sorry man, I got busy with work. Was going to do it today. Thanks for helping me with it - and then doing it.
Ok I've done that.
I ended up just putting in the larger powers of 10 in the format 100_000_000_000_000. I hope that's OK?
I ran it gain, all fine. Then I published again and got an error about failed tests?
I don't think I use numbers larger than 2**53.
The Python tests I copied used 10**14.
But the tests should probably be more numerous and for bigger numbers. I have no idea how to decide how many or how large to make them. Should I do this via trial and error?
I could change everything to int64s or even math/Big I guess, but is this is what's wanted?
Bugger, I think I forgot to put
package kata
as the first line in the solution setup.This comment is hidden because it contains spoiler information about the solution
Thanks. But the author still has to be active to accept the translation I think.
I haven't done the translation yet, but will do so.
This comment is hidden because it contains spoiler information about the solution
I've been using Go for a while. It would be cool to translate this into Go. But I've always found translations difficult to do. Usually the myself and the kata author have no idea how to do it.
If I translated it into Go, would you help me do that?
Thanks for ressurecting this kata, it's a pretty good one.
I don't understand the way you're handling the new lines at all. I don't see why my original code works for all but a few tests? There must be something different about those ones.
But I'll just use that last line of code you provided. Thanks again.
To get it to pass, I had to do this:
So that it removes the leading and trailing '\n' for the small tests.
The last few lines of my code - which I use to return the problem in the correct format are these:
Which gives the correct format for the bulk of the problems. If I remove the leading and trailing '\n' then the first few tests pass, but the rest don't.
Loading more items...