Question: please write in c++. Consider combinatorial puzzles,for example, one such puzzle is POT + PAN = BIB. In these puzzles, you must assign each letter

please write in c++.

Consider combinatorial puzzles,for example, one such puzzle is POT + PAN = BIB. In these puzzles, you must assign each letter a distinct digit, such that if we substitute the digits in place of the letters, the resulting mathematical equation is true. In our continuing example, if we set P=2, O=3, T=1, A=7, N=4, B=5, and I=0, we get 231 + 274 = 505..

in the file proj0.cpp, you will find an incomplete implementation for:

bool verifySolution(std::string s1, std::string s2, std::string s3, const std::map & mapping)

Your assignment is to finish implementing this. To find out what the proposed mapping has for s1[0] (the first character in std::string s1), you can use the member function at of the map class: that is, mapping.at(s[0]). You are not required to check that the digits assigned are distinct, merely that it satisfies the equation.

please write in c++. Consider combinatorial puzzles,for example, one such puzzle is

code:

#include

#include

#include

bool verifySolution(std::string s1, std::string s2, std::string s3, const std::map & mapping)

{

return false; // FYI, this stub is not a correct solution.

}

#include #include #include "projo.hpp" bool verifySolution(std::string si, std::string s2, std::string s3, const std::m2 ap & mapping) return false; // FYI, this stub is not a correct solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!