## 947 - Master Mind Helper

Moderator: Board moderators

### 947 - Master Mind Helper

i am a little bit confused. say secret code is 6678 and our guess is 6797.
now clearly correct color in correct position is 1 (thats the 1st 6), but what about correct color in wrong position? is it 1 or 2? there are two 7 in our guess.
ishtiak zaman
----------------
the world is nothing but a good program, and we are all some instances of the program
ayon
Experienced poster

Posts: 161
Joined: Tue Oct 25, 2005 8:38 pm

oh, i got it, the answer should be 1. i send code assuming both two cases, but got ac using the case where one digit of secret code can engage only one digit of guess code. by the way, for both two cases sample i/o were correct.
ishtiak zaman
----------------
the world is nothing but a good program, and we are all some instances of the program
ayon
Experienced poster

Posts: 161
Joined: Tue Oct 25, 2005 8:38 pm

### Re: 947 - Master Mind Helper

I think this problem is similar of 296. But i do not understood the output of: 567 0 1 & 91543 0 5.
How the output will be 234 & 44.
My program gave output 216 & 1024.
Please, any one discuss how output is 44 for 91543 0 5 ?
SHAKIL
shakil
Learning poster

Posts: 74
Joined: Sat Jul 15, 2006 6:28 am

### Re: 947 - Master Mind Helper

For input 567 0 1, here are the 234 possible secret codes:
Code: Select all
`611711621721631731641741151251351451851951171271371471771871971681781691791612712622722632732642742152252352452852952172272372472772872972682782692792613713623723633733643743153253353453853953173273373473773873973683783693793614714624724634734644744154254354454854954174274374474774874974684784694794115215315415815915125225325425825925135235335435835935145245345445845945155255355455855955185285385485885985195295395495895995116216316416616816916126226326426626826926136236336436636836936146246346446646846946186286386486686886986196296396496696896996618718628728638738648748158258358458858958178278378478778878978688788698798619719629729639739649749159259359459859959179279379479779879979689789699799`

For input 91543 0 5 here are the 44 possible secret codes:
Code: Select all
`5943154931459314935139451439513495154391453915349135491593145391435914591341593439154193541395453194351941539449315394154391534915491351943514935431953419514395134955431945319534193541954139451391543943159341591435913459`
brianfry713
Guru

Posts: 1761
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA