Thanks, i done this on my own but came here to see your approach!
@ankitgupta8353
3 ай бұрын
Nice explanation mate
@krishanpratap3286
5 ай бұрын
I have a Doubt in this test case n= 1 it is shown that Vanya has won but how is it possible as for n = 1 if we increment it n = 2 then Voya can decrement it to make n= 1 again and this can go on until 10 chances are done so Voya should win but in the test case it is wrttien First wins
@sowdub9445
5 ай бұрын
vanya can decrement 1 to 0 and 0 is divisible by 3 vanya wins
@avnishkalyankar5247
5 ай бұрын
@@sowdub9445 thanks alot for this reply! I was so confused.
@thefrontendguru
3 ай бұрын
if ( (n+1)%3==0 || (n-1)%3==0) return First means A(vanya) wins else return Second means B(vova) wins
@sarthakmahale1802
9 ай бұрын
👍🏻
@padmavatishah9922
5 ай бұрын
nahi samja
@kathanvakharia
5 ай бұрын
rewatch the dry run. I tried to keep it as simple as possible 😊
Пікірлер: 9