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.
publicstaticintchangedLetters(chars1,charO,chars2){intcount=0;if(s1!='S'){count++;}if(s2!='S'){count++;}if(O!='O'){count++;}returncount;}publicstaticintmarsExploration(Strings){// Write your code hereintoutput=0;for(inti=0;i<s.length();i+=3){intcount=0;count=changedLetters(s.charAt(i+0),s.charAt(i+1),s.charAt(i+2));output=output+count;System.err.println("count="+count+"output="+output);}returnoutput;}
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 →