Zillow Interview Question
- 0of 0 votes
1. Question: A solution consists of four balls from a set of four different colors. The user tries to guess the solution.- Visions September 26, 2007
If they guess the right color for the right spot, record it as being in the correct 'Location'. If it's the right color, but the wrong spot, record it as a correct 'Color'. For example: if the solution is 'BGRR' and the user guesses 'RGYY' they have 1 'Location' and 1 'Color'. A correct solution would be 4 'Location' and 0 'Color'.
Write a program to, given a solution and a guess, calculate the response that we present to the user.
| Report Duplicate | Flag | PURGE
Open Chat in New Window