Hack the Matrix

Report a typo

As part of his training, Neo needs to decode a series of encoded messages. You have been asked to help him and write a program that uses StringBuilder or buildString to decode the messages. The program should iterate over the encoded message and perform the following:

  • Check if the character is a vowel. If it is, append it to the decoded message.

  • If the character is not a vowel, check if it is a lowercase letter. If it is, append the uppercase version of it to the decoded message.

  • If the character is neither a vowel nor a lowercase letter, discard it.

Sample Input 1:

THe mAtRIX HAs YOu

Sample Output 1:

eMATIASOu
Write a program in Kotlin
fun decodeMessage(encodedMessage: String): String {
// Write your code here
}
___

Create a free account to access the full topic