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.
Hey I learned this today too! 3 years later though...
Thanks (◕﹏◕✿)
Great Kata! Hope to see it in approved
looks good to me
got it
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.
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.
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.
Not sure how relevant "i" is. Perhaps you can display "students" in the "it".
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<
Your proposed solution of "unique" scores seems the easier way out of this, without changing the spirit of the kata :)
yeah, that's another way. But there you find the need for the secondary key again, I believe.
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.
@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
holy fuck... x(
the problem doesn't come from the sorting but from the float computation......... Pretty weird considering what we use.... :/
Loading more items...