Skip to content

geniusmehul/mars_sos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

mars_sos

Problem from HackerRank https://www.hackerrank.com/challenges/mars-exploration/problem

Sami's spaceship crashed on Mars! She sends a series of SOS messages to Earth for help. Letters in some of the SOS messages are altered by cosmic radiation during transmission. Given the signal received by Earth as a string, s, determine how many letters of Sami's SOS have been changed by radiation. For example, Earth receives SOSTOT. Sami's original message was SOSSOS. Two of the message characters were changed in transit.

Function Description

Complete the marsExploration function in the editor below. It should return an integer representing the number of letters changed during transmission. marsExploration has the following parameter(s):
s: the string as received on Earth

Input Format

There is one line of input: a single string, s. Note: As the original message is just SOS repeated n times, s's length will be a multiple of 3.

Constraints

1 <= len(s) <= 99
len(s) % 3 = 0
s will contain only uppercase English letters, ascii[A-Z]

Output Format

Print the number of letters in Sami's message that were altered by cosmic radiation.

Sample Input: SOSSPSSQSSOR
Sample Output: 3 SOSS P SS Q SSO R

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages