Interview Question
- 0of 0 votes
AnswersTwo players and are playing a game.They are given binary numbers as input. Each binary number is represented as a string of characters '0' or '1'. The string always ends at '1'. In one move each player decides a bit position . Then he visits all the numbers and if their bit at that position is '1' then he changes it to '0'. It is mandatory to flip(change '1' to '0') bit of atleast one number in each move. The player who is unable to make a move loses. Player begins the game.
- fordosianDevil August 19, 2018 in United States
Input
First line contains a number as input. Next lines contain a binary string each.
Output
Print A if player A wins , B otherwise. In the next line print the move number of the last move of the winning player.| Report Duplicate | Flag | PURGE
Java
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.