7 kyu
Centroid I
296 of 466user7657844
Loading description...
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.
C# translation
Hello guys! I wrote the function in Javascript, but a strange thing happened.
The random test passes, but in random tests some pass and others don't and I don't understand why.
I checked with one my colleague and it's very strange for him too. What can I do? A thousand thanks.
We do not know what your solution is, so we do not know how to fix it. Sorry.
You assume the amount of points passed to your function is always the same. Not a kata issue.
This comment has been hidden.
Print the input to help you debug your code, already told you what the problem is.
Thanks Chrono 79. But I still don't understand. I got this output:
... Result mismatch - Expected: [-0.82, 0.75, 0.35], instead got: [-2.72, 2.51, 1.18] Test Passed: Value deep equals [-1.54, -0.6, 0.64] Result mismatch - Expected: [-1.33, -0.5, -0.29], instead got: [-2.22, -0.84, -0.48] Test Passed: Value deep equals [-0.77, -0.82, -0.75] Result mismatch - Expected: [-0.31, -0.93, 0.06], instead got: [-0.93, -2.8, 0.19] ...
This is very strange to me! Can you explain a possible reason, please?
As far as I can see, your current code only works for 3 points. If you print the input, you'll see that sometimes your function is given less or more than that.
When I press the ATTEMPT button, the random test begins. How can I print the input there?
See if this link is any helpful: https://docs.codewars.com/training/training-example#debugging-a-kata
Thanks for your help. In fact, I had assumed that there were only three 3D points..
python new test framework is required. updated in this fork
add some examples
OP ain't gonna do that - "This user has deleted their profile"
Why don't you do it? Be the change you want to see!
because i don't any idea how to start :)
Submitting a javascript translation here, needs reviewing and approving
'alr approved some time ago'
Nice little kata! I suggest to add a bit more description (like in this similar kata) and probably randomize the number of vectors in the tests.
Oh, and upvote my solution, because it's the best ;-)))
thanks