W.C. 4.2 Mr. Natwarlal

Natwarlal is a smart person(and a cheat).

He plays a game with different people.

Rules of game :

There are an even number of piles(of coins) arranged in a row, and each
pile has a positive integer number of coins.

Natwarlal always starts first.

The objective of the game is to end with the most stones.
The total number of stones is odd, so there are no ties.

Natwarlal and opponent takes turns, in each turn, a player takes the
entire pile of stones from either the beginning or the end of the row.

This continues until there are no more piles left, at which point the
person with the most stones wins.

Assuming Natwarlal and opponent play optimally.

Whoever wins the game gets to keep all the money used in that game.

Testcases :link

Submit how much money does Natwarlal win.

This challenge is worth 60 points.

You must be logged in to submit a solution

View ranklist for this challenge
About scoring and submission

Contact Us

Kunal Desai : 7715051136

Neelraj Patil : 9930671144

Privacy Policy