Menu

Please Write C Consider Combinatorial Puzzles Example One Puzzle Pot Pan Bib Puzzles Must Q43854433

please write in c++.

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

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

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

Your assignment is to finish implementing this. To find out whatthe proposed mapping has for s1[0] (the first character instd::string s1), you can use the member function at of the mapclass: that is, mapping.at(s[0]). You are not required to checkthat the digits assigned are distinct, merely that it satisfies theequation.

#include <map> #include <string> #include projo.hpp bool verifySolution(std::string si, std::string s2, std::string s3, con

code:

#include <map>

#include <string>

#include <proj0.hpp>

bool verifySolution(std::string s1, std::string s2, std::strings3, const std::map<char, unsigned> & mapping)

{

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

}

#include <map> #include <string> #include “projo.hpp” bool verifySolution(std::string si, std::string s2, std::string s3, const std::m2 ap<char, unsigned> & mapping) return false; // FYI, this stub is not a correct solution. Show transcribed image text #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.

Expert Answer


Answer to please write in c++. Consider combinatorial puzzles,for example, one such puzzle is POT + PAN = BIB. In these puzzles, y…

OR