7 kyu
Student Rankings
255tjf952
Loading description...
Fundamentals
View
Career Accelerator
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.
For some random tests, the expected length seems to be off by one?
['94366 - KzQgybHa - 51.7 43.2 56.2 36.9 46.0', '61746 - jnsGvIel - 53.4 59.2 14.0 34.4', '96362 - EDFTyzLS - 43.6 58.3 85.5', '34877 - yVLBMuTK - 59.0 25.0 60.1', '28164 - xtHvMYWi - 18.3 69.6 98.4 34.8', '29873 - DopOhJfi - 18.2 76.4 29.1 10.2', '67638 - nOXGIqOs - 55.0 89.0 82.6', '58755 - IlLRxYYZ - 94.6 79.2 40.5', '67638 - IETAxXyI - 13.1 83.4 73.2 87.4 13.3']
The attempt length (9) does not equal the answer length (8)
Yet, I'm pretty sure that the list has 9 inputs?
Colored text is difficult to read in light mode.
I don't see any colored text in the description.. perhaps this issue has already been fixed?
I don;t see it either now.
Great Kata! Hope to see it in approved
Thanks (◕﹏◕✿)
Hi again, :)
ok, so:
test.it
block (note: you can nest describe blocks if needed but you have to have one single layer ofit
blocks as "leaves")Cheers
I will look into it thankyou, you are very fast w(°o°)w
if I'm not mistaken, it's because you use
reverse
No secondary key required
secondary key required. ;p look at my solution, you'll see the nuance
(if I'm mistaken thre, that would mean the problem comes from the float thing in my solution... That would be surprising)
Check my fork on your solution. Or am I missing something here?
yup ;) See next fork with the case as fixed test
wait, there's another problem, apparently... My code with his "sorting way" seems to no pass... Investigating...
holy fuck... x(
the problem doesn't come from the sorting but from the float computation......... Pretty weird considering what we use.... :/
@jf952: ok, it seems it's because I use the module while you use... "bare computation", let's say. That's pretty weird, but... nothing related to sorting (I was actually wrong about that, apprently... I'd need a refresh about this detail, maybe).
I see only one way out of this: you try your random inputs and check there are no two students that can be considered "equal". If that's the case you generate another array instead of doing the test
If ordering depends on floating point numbers, perhaps this kata requires exact floating point numbers (Fraction) instead? For the moment, this kata remains ill-defined because of the disprepancy we just found.
yeah, that's another way. But there you find the need for the secondary key again, I believe.
Your proposed solution of "unique" scores seems the easier way out of this, without changing the spirit of the kata :)
So I ran some tests, and it seems that there isn't secondary sorting based on id:
If you want, I can add secondary sorting. As it is now, my solution (the attempt above) only sorts based on grade and keeps it in the same order rather than sorting based on alphanumerical characters in the id.
As for the other notes you left, I believe I implemented them (I learned more stuff on test cases!).
EDIT: I should have refreshed before submitting... whoops >u<
Not sure how relevant "i" is. Perhaps you can display "students" in the "it".
Also about the ordering, the problem is you get 58.21999999999999 while we get 58.22. If 2 students have silimar scores like this, your order might be student 1 -> student 2, while ours is student 2 -> student 1. A secondary key won't change this. The problem is how the mean gets calculated differs between your solution and ours, it's not clearly specififed how to get the mean, and the chosen implementation changes the outcome.
Okay I believe I followed the proposed solution of "unique" scores by comparing the values formatted to one decimal points, if there are same values I create a new list for testing, else I continue. As for the i, I had it just for my logging purposes, so I removed it. Let me know if this satisfies the criteria that was originally posted.
I would still consider changing this:
Remove the log, and add the message you are logging in the "it", so it's part of the test case.
got it
looks good to me
Hey, Pretty sure this wasn't meant to happen! xD https://www.codewars.com/kata/reviews/6064d3eda9223000014c7187/groups/60675c3a4c3ba40001b2e42d
fixed - thank you for letting me know ^v^
now:
dolamroth didn't say
use assert_approx_equals AND rounding
. This is even worse than it was before.=> remove the rounding requirement.
This comment has been hidden.
I believe I fixed what you were stating - sorry for the delay
that part yes. :+1:
(=✖ ᆺ ✖=)
Having multiple output types is bad.
Do you mean a (string, float) is bad?
Now the return type is either
List[Tuple[str, float]]
, orNone
. It is not a good practice, since in real code you may expect, that other code using your function may always expect a list and not handle a corner case with None.Of course, you may say that kata is not real world code, but it rather falls into an unnecessary work for user. Note, that in mine of FArekkusu's solution None is just returned as
sorted(...) or None
.It would be preferrable, if
List[Tuple[str, float]]
was always expected as output.An empty list for an empty list as input could work tho.
Fixed 。◕ ‿ ◕。
/ᐠ。ꞈ。ᐟ\
Use custom comparator with
assert_approx_equals
instead of rounding float values. How to https://docs.codewars.com/authoring/kata/floating-point/#what-are-floating-point-numbersAdded a custom comparator and fixed this!