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 it can happen than one factor is zero (or both...). Non-negative meaning ">=0". I tried your solution and the problem comes when an element is zero because in this case the condition "P = A ** 2 + B ** 2" is not satisfied by your return. It is possible that you have an issue when seeing if a big integer is a perfect square or not.
Allow me to add that your code doesn't follow the right way to find an answer in all cases. Cheers and good luck.
This comment is hidden because it contains spoiler information about the solution
But if the sum is a perfect square itself doesnt that makes finding two factor for it redundant.
and also in sample test setter himself has given us an example in which one factor is 0.
The tests fail when one of returned numbers is 0, while description says the answer needs to be non-negative.
As a temporary workaround you can try to return such pair, where none of the numbers is 0. For example, tests fail for:
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution