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.
Thanks for your feedback. But I very much doubt that it can be solved in O(1). Because the answers grow with increasing values of relatively prime n and m. If you wanted to ask that there is a function that would use only standard arithmetic operations and return an answer, then I don’t know. If you look at the graph, it looks very chaotic. But you can learn more about this problem here https://oeis.org/A323472.
This comment is hidden because it contains spoiler information about the solution
When you have a N-dimensional array, you should use N indices if you want to get a value. For this case:
return matrix[0][0]
This comment is hidden because it contains spoiler information about the solution
I am very pleased to read this, thank you. In this kata, I have a problem with parametrization by limiting the values of the parameters n and m. Because these restrictions are not enough:
If values of n or m are too large, the calculations will take too long.
Thanks for the advice, I fixed it.
If the numbers are too large, the calculation time is too fast.
I've corrected the order of the conditions, so I hope it's clearer. Thanks for the correction.
Added restrictions on arguments
Fixed.
Added.
This comment is hidden because it contains spoiler information about the solution