You are viewing a single comment's thread. Return to all comments →
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); int count =0; for (int i =0;i<s.length();i+=3){ if(s.charAt(i)!='S') count++; if(s.charAt(i+1)!='O') count++; if(s.charAt(i+2)!='S') count++; } System.out.println(count); } }
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 →