You are viewing a single comment's thread. Return to all comments →
void separateNumbers(string s) { int size = s.size(); for (int i = 1; i <= size / 2; i++) { string t = s.substr(0, i); string n = t; long long count = stoll(t); while (t.size() < size) { count++; t += to_string(count); } if (t == s) { cout << "YES " << n << endl; return; } } cout << "NO" << endl; }
Seems like cookies are disabled on this browser, please enable them to open this website
Separate the Numbers
You are viewing a single comment's thread. Return to all comments →