Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ Write a function int mm_score(string k, string g, int &b, int &w) where k is the secret key g is the guess b

in c++

Write a function

int mm_score(string k, string g, int &b, int &w)

where k is the secret key g is the guess b is the number of black points (to be set by your function) w is the number of white points (to be set by your function) and returns 1 if the lengths k,g>0 and equal, otherwise returns 0 and b,w are ignored

File you must submit: soln_func.cc

Examples:

k=111 g=111 b=3 w=0
k=abcd g=dcba b=0 w=4
k=abcde g=edcba b=1 w=4
k=xxxyy g=xyzbx b=1 w=2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago