crypto

Home   »   crypto

#include
using namespace std;


int getNum(string s, unordered_map &charIntMap){
	  string num = "";

	  for(int i = 0; i < s.length(); i++){
		  char ch = s.at(i);
		  num += charIntMap.at(ch);
	  }
        stringstream st(num);
        int x = 0;
        st >> x;
	  return x;
  }
  
void solution(string unique, int idx, unordered_map &charIntMap, vector &usedNumbers , string s1, string s2, string s3) {
	    if(idx == unique.length()){
			int num1 = getNum(s1, charIntMap);
			int num2 = getNum(s2, charIntMap);
			int num3 = getNum(s3, charIntMap);

			if(num1 + num2 == num3){
				for(int i = 0; i < 26; i++){
					char ch = (char)('a' + i);
					if(charIntMap.find(ch)!= charIntMap.end()){
						cout<>s1 ;
    cin>>s2 ;
    cin>>s3 ;
    unordered_map charIntMap;
    string unique = "" ;
    for(int i = 0 ; i usedNumbers(10) ;
    solution(unique, 0, charIntMap, usedNumbers, s1, s2, s3);
    
}

Leave a Reply

Your email address will not be published. Required fields are marked *