Gurbuz is a talented computer engineering student who loves to develop games. He invented a card game, in which two players receive 3 hidden cards from cards at the beginning. There are 100 cards and each card has a number between 1-100 written on it. A player does not know what cards the other opponent received. The game starts after players receive their cards. There will be 3 rounds. On each round, the players will pick a card among 3 cards that they received in the beginning. If a player has picked a card with value greater than the opponent’s choice, then the player wins the round. Whoever wins 2 rounds out of 3 wins the game. Nazlı is also another computer engineering student and heard about the game and found a serious bug. Now, she has the chance to interfere before she receives the last card from the game. She can see all 5 cards that the game assigned until now and she can make the game assign whichever card she wants as her last (third) card. Nazlı wants to mock with Gurbuz. She wants to win every time or wants to withdraw if she is going to lose inevitably. How could she do this? Write an ITERATIVE solution for solving this problem. The input has 5 cards between 1-100, first 3 cards are Gurbuz’s cards and last 2 cards are Nazlı’s cards. You need to find a card that makes Nazlı win the game no matter how badly she plays. If there are multiple cards that guarantee a win for the game, print the card with the minimum value. If there is no card that guarantees a win for the game, you need to print “WITHDRAW”.
-
Notifications
You must be signed in to change notification settings - Fork 0
KereMath/Card-Game
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published