Created
September 6, 2016 20:29
-
-
Save ooade/5ebc97c9254898fdedd9f9969646a900 to your computer and use it in GitHub Desktop.
Mars Exploration 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
let N = readLine() | |
let S = N.match(/.{1,3}/g); | |
let R = 'SOS'.repeat(N.length / 3).match(/.{1,3}/g); | |
let count = 0; | |
for (let i in S) { | |
for (let j in S[i]) { | |
if (S[i][j] !== R[i][j]) { | |
count++; | |
} | |
} | |
} | |
console.log(count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment