Hackerrank – Mars Exploration

Hackerrank – Problem Statement

A description of the problem can be found on Hackerrank.

Solution

I divided the whole string into to 3-character parts. Then I checked for each triplet if first character is equal to S, second to O and third to S. And counted the changed letters.

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby

Leave a Reply

Your email address will not be published. Required fields are marked *