InterviewBit Academy is now Scaler!
InterviewBit Academy is now Scaler Academy!

Deepu and girlfriend

Little Deepu recently got a new job, so to celebrate, he decided to take his girfriend, Kate, out on a fancy candle light dinner. To make things perfect for Kate, Deepu planned the night to the last detail. The food, the music, the ambience, everything was perfect, but stupidly enough Deepu forgot to get her a present. After dinner, Kate asks our Deepu for her gift, when she finds out that he hasn't got her any she gets upset, to try smooth things with her, he proposes a game, this makes Kate so angry that she dumps him right there(bad move Deepu). Well its safe to say the rest of the evening was uneventful for Little Deepu but the game he proposed was pretty interesting. To put the game a bit formally, we have two players Little Deepu and Kate and M items in the bag B, also we have a game set S with N elements, each element of game set is an integer. The game is played as follows, each player takes turn to pick an element from the game set S and removes that number of items from the bag, the player that is unable to remove the items from the bag looses the game. Little Deepu start the game ,If both Little Deepu and Kate play the game optimally, your task is to determine who wins the game.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Deepu and girlfriend on Interview Code Editor
Sign Up
to access hints and editorial solutions for Deepu and girlfriend


Click here to start solving coding interview questions