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.
solution is so simple, and I created such a monster, lol
measuring the same way as above, hopefully correctly ( on w3schools.com)
time in ms: 256
time in ms: 202
time in ms: 187
time in ms: 187
time in ms: 187
time in ms: 187
time in ms: 187
time in ms: 187
time in ms: 188
time in ms: 187
anyway, I guess now I can see, my solution could be probably more efficient
How long does your solution run for n=77587907?
come on...
I am measuring the same code on w3schools compiler....
it gives me less then 100 ms....
time in ms: 54
time in ms: 35
time in ms: 34
time in ms: 34
time in ms: 34
time in ms: 34
time in ms: 34
time in ms: 35
time in ms: 34
time in ms: 34
public static void main(String[] args) {
}
public static void measureExecutionTime() {
}
That was a tough one for 5kyu! Definitely a challenge to get an efficient enough solution.
Execution Timed Out (16000 ms)
oh, come on.... tests are passed, I just need few millis more....
it's not hanging forever, anyway...
completely gave up on this one...
This comment is hidden because it contains spoiler information about the solution
by default Math.pow method returns result of type double...
so there might be truly an error in those tests...
perhaps method findNb should return double and not long...
it is very interesting it seems that starting from n = 32768
there are different results for type long (r1) and double (r2)...
which result is true then...?
.
.
.
n=32765, r1=288142425153114400, r2=288142425153114400.000000
n=32766, r1=288177603083145504, r2=288177603083145504.000000
n=32767, r1=288212784234107168, r2=288212784234107168.000000
n=32768, r1=288247968606195968, r2=288247968606195970.000000
n=32769, r1=288283156199608576, r2=288283156199608580.000000
n=32770, r1=288318347014541568, r2=288318347014541570.000000
n=32771, r1=288353541051191552, r2=288353541051191550.000000
n=32772, r1=288388738309755200, r2=288388738309755200.000000
.
.
.
However I still do not understand how it works,
I added type casting to my previous solution, because, when trying to test failing solution,
compiler gave me warning,
but we are summig integers in both cases, so why it does not work...
.
thank you for the tip!
There is already an opened suggestion to update Ruby.
Because it's not what you are supposed to do. Obviously, "a" cannot be rearranged to make "aaaaa".
Loading more items...