We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
publicstaticintmarsExploration(Strings){// Write your code hereintdiff=0;for(inti=0;i<s.length();i++){if((i%3==0||i%3==2)&&s.charAt(i)!='S'){diff++;}elseif(i%3==1&&s.charAt(i)!='O'){diff++;}}returndiff;}
Cookie support is required to access HackerRank
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 →