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.
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...
thank you!
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.
thank you for the info. And you are absolutely right about JavaScript does not have 64-bit integer. But from -(2^53 - 1)till 2^53 - 1, you will not loose percision, according to the mozilla documentation. So from my understanding, to say JavaScript only has 32-bit integer is not correct.
or here http://ecma-international.org/ecma-262/5.1/#sec-4.3.19
this is not true, have a look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
just some idea, maybe we could test if the solution submitted eval the sequence eagerly?
thx for the kata!
oh, forgot to use recur...
Loading more items...