You are viewing a single comment's thread. Return to all comments →
My Solution in kotlin covering All test cases.
fun marsExploration(s: String): Int { var counter = 0 val lastIndex = s.length - 1 for(i in 0..s.length step 3) { if (i > lastIndex) break if (s[i] != 'S') counter++ if (s[i + 1] != 'O') counter++ if (s[i + 2] != 'S') counter++ } return counter }
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 →
My Solution in kotlin covering All test cases.