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.
An articulated and helpful comment, even if it were criticism, is always welcome, thanks! :)
parseInt isn't required here, (Integer. str) (with a space after the ., for some reason the space is getting removed in my comment) gets the job done. parseInt would avoid errors if there are any letters in the middle of the string, but knowing that the inputs will always be numerical makes this unneccessary. Not a criticism, just a comment
2203ms
hi, I test with my solution it works for the case mentioned by Anton, but still fails with real test cases. Could you give a hint what could be the difference between the case above and real test case?
thx for pointing it out!
but I'm not a JS guru, could you explain what's the worst thing could happen? Maybe the limit of recursion level? Yes it's definitely will causing problem... even in some language that has better support for recursion...
double recursion at
toString
?!?!oh no...
thank you!
Recent changes in the codewars platform broke the original version of this kata. I have updated the example test fixture so that the tools are available. In any case, submitting your solution always worked; it was only the "run tests" that was broken.
oh, I got it. After converting each char in original String, I need to keep the length of final binary representation for each char to 8.
hi delfeugo,
thanks for the kata!
I think I'm stucked at the 'easy' test for encoding.
I got 32-bit int of block 'easy' in decimal 213416441.
The rest of encoding gives me
I believe the rest part of the encoding (after getting the 32-bit integer) is correct, because I've tested the example in wikipedia page. But the final encoed result is <
%(LTY> for 'easy'. Do you have any idea where the problem might be?thanks in advance!
As Ecma262 defined, Number are 64-bit double in IEEE 754 standard. And here is the wikipedia page http://en.wikipedia.org/wiki/Double-precision_floating-point_format
But your original statement could be modified a bit to make it valid, instead of:
"JS has only 32-bit integers."
say:
"In JavaScript, the operands of all bitwise operators are converted to signed 32-bit integers in two's complement format."
referrence:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators
http://www.ecma-international.org/ecma-262/5.1/#sec-11.10
This is really an interesting kata, but unfortunately I can not run test...
Here you can find several algorithms to roll a loaded dice.
http://www.keithschwarz.com/darts-dice-coins/
This comment is hidden because it contains spoiler information about the solution
yes! with alais method it is possible to have population bigger than 1k!!! I think it could be even larger, since the select is really O(1) complexity for time.
Loading more items...