re: Daily Challenge #18 - Triple Trouble VIEW POST

FULL DISCUSSION
 

Seems like a good problem for regex with backreferences. JavaScript:

function tripledouble(num1, num2) {
    return /(\d)\1\1.*,.*\1\1/.test(`${num1},${num2}`) ? 1 : 0;
}
code of conduct - report abuse