7 kyu
Graceful Tipping
652 of 1,498viktorostlund
Loading description...
Mathematics
Fundamentals
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.
This challenge helped me flex a new problem-solving approach. Really enjoyed tackling it in a different way—thanks!
python new test framework is required. updated in this fork
Approved
8kuy or 7kuy kata with rounding is annoying.
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
Enabled in this fork
This comment has been hidden.
This comment has been hidden.
How is that 7 kyu? I hate it when you don't know if you're wasting your time trying to beat unbeatable Kata for your current level or you just can't see obvious. Finally you give up and open solutions only to find out someone not very smart set crazy low rank for the Kata. What the hell? I don't want more honor for the task I just don't want to spend hours solving unsolavable katas.
I'm not sure but... it looks like in
C
tests are a bit invalid because i always get smt like this:should_pass_all_the_tests_provided < For bill = 800000 >\n Submitted: 850000 Expected: 4200730
or< For bill = 1000 > Submitted: 1500 Expected: 4199974
What the ...?
I'll take a look
Nevermind. After your answer I decided to check my code YET ONE MORE LAST TIME and of course have found a bug. My fault.
Thanks for commenting ~ indeed there was one incorrect format specifier. Fixed. Should be good to go, please try again.
My code works. All looks pretty good. Thanks.
The primary tests in python test for gracefulTipping, yet the remaing tests use graceful_tipping. Please fix.
Seems to be fixed.
Add a fixed test with
bill = 50/1.15
. I had a student wrongly solve the task but all the tests passed.I feel like this should be labeled higher kyu than 7kyu.
Can't be changed.
Bad Python tests.
86 should return 90 as it is the next divisible by 5, not 100. 99 should return 100 as it is the next divisible by 5, not 150.
It works for me in all my own tests following the instructions.
Yeah, right.
Am I the only one who has had their code work in an editor but not work in codewars?
We get comments on this non-stop. If you find any problem with the site, be prepared to show evidence for it. But 99% of the time, the foreign environment is wrong or lacks coverage.
.
Maybe it's better to set tips for 7 on 10 (in tests it is 9).
JavaScript, wrong samples 99 and 983212
Read the description again.
I had to import math for the random tests to run on a solution that uses no math functions.
Sorry, fixed
JS, TS, and Ruby use floats, but C and Python use ints. It is not clear.
Updated python to generate floats as well, so only C remains.
Anyway, for a bill it makes sense to have floats, as most currencies have and use a smaller (sub)unit.
C now passes in
bill
with "coinage"Ruby translation kumited -- please check and approve
Thanks
Math.floor(11.99) should return 11. But here its return 13. fascinating website.
RTFM?
Sorry bro I was just losing my damn mind
The initial solution in TypeScript is wrong.
The tests are terribly slow in Python. Could you use something that doesn't take 3(!) seconds to round a number 100 times as the reference solution?
The tests should not log anything.
New Python test framework should be used.
The function name should be in snake_case in Python.
No random tests.
There should be (at least) 100 random tests, and they should not be bound by specific
[1eN, 1e(N+1))
ranges like they are now.The sample tests are wrong.
I wonder that why the bill 86 ->101.17 -> 100, while the bill 99->116.47->150
how do you get
101.17
?