Our friend can't stand the r
letter (no joke). Can you help him get rid of them in the text?
Create the companion object with removeLetter()
function. It should accept the String input
variable and return an array of characters.
In the array, all letters have to be lowercase, and all r
characters must be replaced with !
.
💡 Make sure to treat the removeLetter()
method as a static method in Java code!
For instance:
//input example
val input = "Remove Letters"
//result example
['!', 'e', 'm', 'o', 'v', 'e', ' ', 'l', 'e', 't', 't', 'e', '! ', 's']