5 kyu
Base64 Numeric Translator
108 of 1,216danielpclark
Loading description...
Puzzles
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.
Scala translation
Rust translation
D translation
Go translation (author is inactive).
Missing
it
blocks for sample and fixed tests (in python)wierd. when i look at the "Test Cases" section on this page i do see
it
blocks. also when training on the kata i seeit
blocks. but in the actual translation it missing..nvm, now there's alr, I forgot to reset trainer I think XD
i added them in the meantime ^^
new Python translation. mainly added random tests and appropriate use of the tests framework.
approved
5 Kyu ranking seems much too high, for sure for C.
agree
No random tests in:
added random tests here. please review.
added random tests to ruby
COBOL translation, including random tests (author is inactive).
C Translation published, has random tests, waiting for feedback and/or approval.
No random tests.
re-raising with details
[JavaScript] Identifier names (except for constructor functions) should be in
camelCase
(source) and notsnake_case
- please change the name of the user solution frombase64_to_base10
tobase64ToBase10
.fixed with backwards-compatibility
This comment has been hidden.
Did a Java translation. Please review and approve.
This was a great kata, but I would argue that it is closer to a 7/6 kyu difficulty level.
I have been having trouble with meeting the 600ms time limit for multiple kata's including this one.
Could anyone please give me tips?
Maybe a term or topic I could google/research on?
Without knowing what you tried to come to this difficulty I don't know what to tell you. In JavaScript there may be a noticeable diference in how you multiply by powers of another number. But people have been successful in both main ways.
Some language I fear might still miss enough random tests, plus for the future try to keep naming conventions (snake_case for Python or Ruby, camelCase for JS, etc).
Quite enjoyable kata anyway :)
(This issue affects JavaScript and CoffeeScript, or any other language that automatically switches to double/doesn't support arbitrary large integral numbers)
The test case
"1234567890"
expects970208572785807200
. However, that number exceeds the range for (unsigned) 32bit integers. Therefore, JS falls back to double precision values. The largest integral value one can save there isNumber.MAX_SAFE_INTEGER
(9007199254740991), so one has to expect approximation issues. Alsolog10(9702085727858072) > 15
, therefore the last number can depend on how you sum the number. And indeed, if you use Horner's method, you'll end up with a wrong answer: 970208572785807___1___00.So either use relative error checking for those numbers that exceed the range of safe integers, or don't use too large values (
Number.MAX_SAFE_INTEGER
is"f////////"
in base64). See also the Codex section (JavaScript specific section).Thanks for letting me know! I'll look into it. I had noticed after adding bigger numbers anything that didn't usee double star
**
syntax failed to pass.I've removed the larger cases.
Needs some random tests.
Added. Should be good enough right?
Hi there I found a bit of a problem with the third example test case for Python:
This should be either this:
or this:
The original is correct. It's currently "BA". There is no "AB" test. Perhaps you accidentally switched them?
Issue resolved (user error).