You are viewing a single comment's thread. Return to all comments →
//java public static int marsExploration(String s) { // Write your code here int changedLetters = 0; char[] chars = s.toCharArray(); for(int i=0; i<s.length(); i+=3) { if(chars[i] != 'S') changedLetters++; if(chars[i+1] !='O') changedLetters++; if(chars[i+2] !='S') changedLetters++; } return changedLetters; }
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 →