You are viewing a single comment's thread. Return to all comments →
Js solution:
return s.split('').reduce((accumulator ,letter, currentIndex: number) => { if( ((currentIndex%3 === 0 || currentIndex%3 === 2) && letter !== 'S') || (currentIndex%3 === 1 && letter !== 'O') ){ return accumulator += 1; } return accumulator; }, 0);
}
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 →
Js solution:
}