You are viewing a single comment's thread. Return to all comments →
I had a similar approach with JS here:
let sos = `SOS`; let j = 0; let count = 0; for(let i = 0; i < s.length; i++){ if(sos.charAt(j) !== s.charAt(i)){ count += 1; } (j === 2) ? j = 0 : j++; } return count;
Seems like cookies are disabled on this browser, please enable them to open this website
Mars Exploration
You are viewing a single comment's thread. Return to all comments →
I had a similar approach with JS here: