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.
I agree.
Here's a link I found useful-
https://brilliant.org/wiki/integral-approximation-simpsons-rule/#
I'm trying to figure out n = 12 and this is how to get 9 and 3
n = 12
Alice Turn: Alice = 1, Bob = 0, Remain = 12 - 1= 11
Bob Turn: Alice = 1, Bob = 1, Remain = 12 - 2 = 10
Alice Turn: Alice = 5 + 1 = 6, Bob = 1, Remain = 12 - 7 = 5
Bob Turn: Alice = 6, Bob = 1 + 1 = 2, Remain = 12 - 8 = 4
Alice Turn: Alice = 6 + 1 = 7, Bob = 2, Remain = 12 - 9 = 3
Bob Turn: Alice = 8, Bob = 2 + 1 = 3, Remain = 1
Alice Turn: Alice = 8 + 1 = 9, Bob = 3, Remain = 0
Approved
Ranking is too high, it should be a 7.
ahahaha fr
I think it would even be approved 8, nowadays... XD
Nice kata but it's not a level 5 at best it's an easy 6.
This kata is more difficult than an 8!
In JS, you may want to use BigInt for intermediate calculations. Also, calculating big powers knowing the result should be a mod by can be very expensive.
This comment is hidden because it contains spoiler information about the solution
Yes, I mean that it is probably better to say something like 'change that method'.
Sure I need more experience to get such things better )).
it seems the test for
1000
has invalidated a great many solutions. should this test be removed ?OK I have it now. 10 guesses is sufficent to solve any number between 1 and 1000!
Thanks for your help.
yes, there is a more efficient algorithm. you should not be picking numbers randomly.
Wrong. There should be no randomness involved in your algorithm. Otherwise, you're right: you may need more than 10 guesses.
After the first guess, why do you need to pick a random number? Why did you pick 500 initially?
Loading more items...