6 kyu
Loose Change
3,903 of 5,958ghost_pilot
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.
Why can't I print out the input on the tests I'm failing? Console log is only working on some of the test cases but not on all of them. The console log is the first line of the function.
You're not printing the input, you're printing
'hello?'
there.This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/93 Please join the discussion to help us identify duplicate kata and retire them.
Wouldn't it make more sense to return the hash with the denominations sorted in an order (asc or desc)
or is (nickels, pennies, dimes, quarters) a conventional way to do it?
This is a duplicate of https://www.codewars.com/kata/5365bb5d5d0266cd010009be
This comment has been hidden.
The test is ok.
my bad i read it wrong it works fine now tnx
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.
Python: I was able to finally complete the code to this Kata...but when I attempt it, it comes up with the failed even though it is correct. Why is this?
ex: {'Nickles': 0, 'Pennies': 4, 'Dimes': 0, 'Quarters': 1} should equal {'Nickels': 0, 'Pennies': 4, 'Dimes': 0, 'Quarters': 1}
Though I failed all of my test cases even if they are correct??
Not a kata issue, check this:
oml im so dumb thank you for piointing that out
Java Translation. Please review
It may just be that my solution was kind of messy and basic, but I felt that the way I solved it made this Kata much easier than many level 7 Katas I have completed in the past. Perhaps it is because I used python and/or very basic, fundamental methods? I am not entirely sure, would love to hear what others thought about this.
It's a pretty old kata (4 years), and many of these early katas seem to be overrated compared to the newer ones. Just take the easy points and enjoy! ;-)
Im confused as to why I get an exit code error if I return the dictionary and its correct key value pairs?
Language? Input? Error log?
Bro you can't just tell us there is a problem and not give us any information to work with.
do you want me to post my code or a screenshot? I compare it to the results when I run it and they're all right. I also get an exit code error, no clue what that means.
Can you tell us what language and just copy and paste the error message? Are you returning the entire dictionary? Or are you trying to return each individual key/pair?
Specify the language, print the input and copy-paste the log (the meaningful part of it).
Im using python 3.6 and I'm returning the entrie dictionary. The only error message I get is that the responses don't match when they do. This is gyazo link that shows the output, https://gyazo.com/5ff93f8e697791642214b6eba4469922.
This comment has been hidden.
edit: spelling mistake...
I'm having the same problem, was this resolved?
Py 3.6.0
Exit code 1: {'Nickles': 0, 'Pennies': 4, 'Dimes': 0, 'Quarters': 1} should equal {'Nickels': 0, 'Pennies': 4, 'Dimes': 0, 'Quarters': 1}
This comment has been hidden.
What's
MONETS
?Sorry, forgot to copy
MONETS = { 'Quarters': 25, 'Dimes': 10, 'Nickels': 5, 'Pennies': 1, }
Dictionary keys aren't sorted as you created it in Python 2.7, and it's testing for pennies first.
Thanks. Unfortunately, version 3.6 is unavailable for this task.
Now it is, you're welcome.
Thank you.
This comment has been hidden.
Enabled.
This comment has been hidden.
Approved, could you add the random tests to Python now?
Done!
6 kyu and no random tests? (python) Oh yeah, it's old...
Random tests added
This comment has been hidden.
The random tests work.
But the example test fixtures are broken. They pass when the return is
undefined
,null
,true
, orfalse
.What language?
Sorry, it's been so long that I can't remember which language I attempted. I should have noted at the time. Probably JavaScript?
I think the coins structire could be organized by value. 25 / 10, 5, 1. Helpful for people that are not use to those names in their currency.
Not an issue.
.
This comment has been hidden.
Thanks again for the feedback guys really helpful! I have added test cases and additional information for your suggestions:
I still have to figure out how to deal with extremely large numbers...
Would you happen to have any solution for dealing with extra large numbers?
I am finding that the function gets fairly unpredictable if a number with more than 10 digits is passed. I thought about adding a rule that would limit the user to less than 11 digits. Then the solution code would have to include some sort of logic like:
But that seems fairly ugly. I tried to do some research to figure out a better way to deal with it but came up empty handed. Any advice would be greatly appreciated.
Thanks for the feedback and JS translation guys! I will add to the description later today. I realized that I missplelled 'Nickels' (was Nickles) so I made that correction. Cheers!
JS translation kumited.
Description modified (JS example & Coins values), random tests added. As this is your first kata you may be interrested by how to approve (or not) a kata
Previous JS translation deleted, new translation kumited.
(Typo fixed ("Nickles" -> "Nickels") and new spec tested (cents < 0 or not integer). Description also modified (JS example)
Of course approving process is still the same
It would be nice to precise in Description how many cents counts each denomination. # ( penny (1¢) nickel (5¢) dime (10¢) quarter (25¢) half dollar (50¢) dollar ($1) )
I know we can "google/wikipediate" it but it's better if it's in description.