function separateNumbers(s) {
let subString = "";
let isValid = false;
if (s.length === 1) {
console.log("NO");
} else {
for (let i = 1; i <= s.length / 2; i++) {
subString = s.substring(0, i);
let num = BigInt(subString);
let validString = subString;
while (validString.length < s.length) {
validString +=BigInt(++num);
}
if (s === validString) {
isValid = true;
break;
}
}
if (!isValid) {
console.log("NO");
} else {
console.log("YES", subString);
}
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)