Skip to content

Instantly share code, notes, and snippets.

@ooade
Created September 6, 2016 20:30
Show Gist options
  • Save ooade/e99f41887c59c62620903ea813c1f840 to your computer and use it in GitHub Desktop.
Save ooade/e99f41887c59c62620903ea813c1f840 to your computer and use it in GitHub Desktop.
Mars Exploration 2
function main() {
let S = readLine().match(/.{1,3}/g);
let count = 0;
for (let i in S) {
if (S[i][0] !== 'S') {
count++;
}
if (S[i][1] !== 'O') {
count++;
}
if (S[i][2] !== 'S') {
count++;
}
}
console.log(count);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment