5 kyu
Find four numbers
116 of 172myjinxin2015
Loading description...
Mathematics
Puzzles
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
If you solved this, and are ready for a challenge, go ahead with this kata: Express number as sum of four squares (1 kyu)
python: invalid type hint in default code
you're looking for a tuple, a list doesn't include its length in its type
The following basic test case in Python would contradict the description.
test.assert_equals(find_4_numbers(110), [9, 4, 3, 2])
While [9,4,3,2] is a solution:
110 = 81 + 16 + 9 + 4 110 = 9^2 + 4^2 + 3^2 + 2^2
The solution with the largest a-value is [10,3,1,0]:
110 = 100 + 9 + 1 + 0 110 = 10^2 + 3^2 + 1^ + 0^2
[10, 3, 1, 0]
is not a valid solution because it does not satisfy the conditiond > 0
.Python, probably others: add e.g. this fixed test case
435602 --> [659, 36, 4, 3]
Some solutions find
[660, 0, 1, 1]
instead, wherea >= b >= c >= d > 0
is not truegood job myjinxin2015
Python translation
The function is annotated with
tuple[int, int, int, int]
, but you expect alist[int]
in the tests. Please change the tests to expect atuple
.Fixed
approved at some point
D translation
the characteristics of the tests should be given in the description (number of tests and upper bound)
Added
Could someone translate this to proper english? I just cannot figure out the meaning... :/
My beautiful pending c# translation has the following comment:
thx
There is an error in the tests for JS.
Please be more clear when raising an issue, which test, which error?
I'm sorry, I read the condition inattentively...
Closing then.
C# Translation ready for review.
approved by a shadow in the dark
COBOL translation.
approved
JS: the test cases are a mess, full of unused stuff. Needs to be cleaned.
Once again, incredible Kata from @myjinxin2015!
Great. Short & clear description it is a good motivation to solve the kata :)
Happy coding
^_^