DEV Community

loading...

Discussion on: Daily Challenge #18 - Triple Trouble

alvaromontoro profile image
Alvaro Montoro • Edited

To achieve that, the only change would be in the if statement. Instead of doing x*3 and x*2, it would be ''+x+x+x and ''+x+x respectively:

if (strNum1.indexOf(''+x+x+x) > -1 && strNum2.indexOf(''+x+x) > -1) {