package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/mars-exploration
 */
public class MarsExploration {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
    }
}

@@ -258,16 +258,380 @@
 next();%0A
+        int count = 0;%0A        char%5B%5D word = new char%5B%5D%7B'S', 'O', 'S'%7D;%0A        int idx = 0;%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            if (idx == word.length) %7B%0A                idx = 0;%0A            %7D%0A            if (word%5Bidx%5D != s.charAt(i)) %7B%0A                count++;%0A            %7D%0A            idx++;%0A        %7D%0A        System.out.println(count);%0A
     %7D%0A%7D%0A

Solve Mars Exploration problem