Computer Science, asked by prinayanshinde, 5 months ago

You are required to play a game of Bulls and Cows, with a computer. The game is a word-game, and proceeds as follows

The computer 'thinks' of a four-letter word consisting of letters A to D
Then it proceeds to give you several clues, as to what the word is
Given the clues, you have to work-out the word that the computer thought of (secret-word)

The computer, keeping in mind our agrarian roots, gives clues in the form of 'bulls' and 'cows'! Given a guess-word, it tells us the number of 'bulls' and 'cows' in the word. A 'bull' stands for a letter which is in it's correct place in the secret-word, and a 'cow' stands for a letter which is present in the secret-word, but not in the correct place. However, to make the game a bit challenging, the computer does not tell us which letter is a bull and which one is a cow! Bulls are counted first and then cows. Additionally, each letter in the secret-word is counted only once.

For example, if the computer thought of the word: BDAA and the guess-word is: ADDA, then the computer would respond as 2 bulls and 1 cow. This is so, because the letters 'A' and 'D' in the clue word are present in their correct places (with regard to BDAA) and hence 2 bulls. The other 'A' in the guess-word is present in the wrong place (with regard to BDAA) and hence 1 cow.

Given several such clue words and the number of cows and bulls for each word, your program should be able to work out the actual word that the computer had thought of.

Answers

Answered by wwwarmanmir2
1

Answer:

hxjfifu गीफिर का अध्यक्ष बनाया है कि सचिन को लेकर एक

Explanation:

गूलर की बात कही थी और व को यह तो वो बोला अरे भाई को राखी ने दिग्गी राजा ने अपने जीवन को भी काम भी कर दिया था उन्होंने बताया की बात नहीं हो सकती थी कि इस चित्र

Similar questions