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.
EN
This kata should be minimum 6, if not 5
RU
Эта ката должна быть минимум 6, если не 5
EN
minimum 6, if not 5
RU
минимум 6, если не 5
i thought that i would never solve this, but i spotted your comment, gained some faith and within a minute found a pattern. Almost feels like cheating))
Enabled in this fork
Your code is wrong because you rely on approximate values to give exact answers. If your code does produce different results elsewhere then you might be on a different architechture (ARM?) and it would still be wrong even if it should happen to incidentally give correct answers, if that's even the case.
Something is weird in Python. I get correct test results locally in VSCode with Python 3.12.7. Here with Python 3.11 the True cases are returned False by the same code. Is the is_integer() function evaluated differently here? Or was there a bug with math.cbrt() in 3.11? Or is it something else? What is going on?
Yes, the reference solution for java incorrectly checks for exactly 2 sets of 2 cubes that add up to
n
instead of at least 2 sets of 2 cubes.I think you need to edit task. There were written: sum of two cubes in two different ways. But in fact the wright solution is: two and more different ways
This comment is hidden because it contains spoiler information about the solution
Sorry for the misunderstanding, I must've misread the text
Thanks!
dani is correct, you need to be able to express the number as two different sets of two cubes in order to return true.
The description says to check if the number can be written as the sum of two cubes in two different ways, there's nothing to suggest that it can only be written in two ways.
The description of the kata or the tests need to be corrected.
To me, the kata asks to check if a number can be written as the sum of two cubes in EXACTLY two ways. But if we test for EXACTLY two pairs, we fail the tests. The tests consider correct a number that can be written as the sum of two cubes in AT LEAST two ways.
I may be reading the text wrong, but the number has to be written as the sum of cubes in two ways. n=a^3+b^3=c^3+d^3, where a,b,c,d are positive and different.
From what you are saying, for 46163 you've only managed to find a pair of numbers that satisfy that condition
Same here. Hardcoded, but still an issue.
Loading more items...