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.
Why for number 9007199254739993 function should return false and for number 9007199254740991 number? They both save 53 bits numbers
"So, as long as the integers and their sum are never larger than 53 bits in magnitude..." "a and b will always be valid integers." , so a and b they always safe or not?
As future reference, functions returning mixed types (boolean/number) is generally considered an antipattern.
That was not the case, maybe you need to edit the discription a bit. User have to check if inputs are still safe.
I got the same error because i was attempting to print the arr while testing my solution. Once I removed the print the kata worked without issue.
That's looking much better.
As a minor point, there are three conditions that can lead to a
false
result, and you're probably testing only one of them with these test cases. (a+b
, and nota
orb
individually.) For completeness, the random tests should probably have possibilities for any and all ofa
,b
anda+b
to be out of bounds, or not. But for a 7kyu kata, this should suffice to weed out the likes of Hacker Sakana and me. :]Thanks!
Thanks, I think I fixed the random tests.
This is not the way to do random tests. The answer has to be random, not just the arguments. Run random arguments through a reference solution and compare the user answer to that answer, don't just pick random arguments that lead to a predictable answer anyway.
I see a test where r=6 and the answer is Sheldon, as expected. Not sure where you are seeing what you are seeing. I solved in JavaScript, maybe there is an error in a different language.
"IIV" is correct roman numeral format. To represet three you would use "III"
Its wrong.
solution("IIV") return 2 instead of 3.
It's about time that I learn how to deal with big integers in Javascript. Can anybody point me in the right direction for learning the best way?
I'm not asking anyone to solve this for me, just point me in the right general direction for learning how to deal with very large numbers in Javascript.
Added a three random test cases.
Needs random test cases
This comment is hidden because it contains spoiler information about the solution
Loading more items...