- deque, Searching, Strings

Check if given Strings can be made equal by inserting at most 1 String

#include using namespace std;  bool areSimilar(string S1, string S2){        int N = S1.size();          int M = S2.size();              if (N == M) {                        if (S1 == S2)            return true;                  return false;    }          deque X, Y;                  S1.push_back(‘ ‘);    S2.push_back(‘ ‘);      string temp = “”;          for (int i = 0; i < N + 1; i++) {                                  if (S1[i] == ' ') {            X.push_back(temp);            temp = "";        }        else {                                    temp += S1[i];        }    }          for (int i = 0; i < M + 1; i++) {                                  if (S2[i] == ' ') {            Y.push_back(temp);            temp = "";        }        else {                        temp += S2[i];        }    }          while (X.size() > 0 && Y.size() > 0           && X.front() == Y.front()) {                          X.pop_front();        Y.pop_front();    }          while (X.size() > 0 && Y.size() > 0           && X.back() == Y.back()) {                          X.pop_back();        Y.pop_back();    }              if (X.size() == 0 || Y.size() == 0)        return true;              return false;}int main(){        string S1 = “Start practicing on GeeksforGeeks”;    string S2 = “Start GeeksforGeeks”;          if (areSimilar(S1, S2))        cout