Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 566 Bytes

contamination_№1_string.md

File metadata and controls

25 lines (19 loc) · 566 Bytes

Description

An AI has infected a text with a character!!

This text is now fully mutated to this character.

If the text or the character are empty, return an empty string. There will never be a case when both are empty as nothing is going on!!

Note: The character is a string of length 1 or an empty string.

Example

text before = "abc"
character   = "z"
text after  = "zzz"

My Solution

def contamination(text, char)
  char * text.size
end