/**
 * Given a sentence, return a list with the following parts:
 * 1) First letter of each word
 * 2) Last letter of each word
 * 3) All words except the last one
 * 4) All words except the first one
 * 5) Reverse order of words
 */
fun getSentenceParts(sentence: String): List<List<String>> {

    // Split the sentence into words
    val words = sentence.split(" ")

    // First letter of each word
    val firstLetters = words.map { it.first().toString() }

    // Last letter of each word
    val lastLetters = words.map { it.last().toString() }

    // All words except the last one
    val wordsExceptLast = words.dropLast(1)

    // All words except the first one
    val wordsExceptFirst = words.drop(1)

    // Reverse order of words
    val reversedWords = words.reversed()

    return listOf(firstLetters, lastLetters, wordsExceptLast, wordsExceptFirst, reversedWords)
}
/**
 * Given a sentence, return a list with the following parts:
 * 1) First letter of each word
 * 2) Last letter of each word
 * 3) All words except the last one
 * 4) All words except the first one
 * 5) Reverse order of words
 */
fun getSentenceParts(sentence: String): List<List<String>> {
/**
 * Given a sentence, return a list with the following parts:
 * 1) First letter of each word
 * 2) Last letter of each word
 * 3) All words except the last one
 * 4) All words except the first one
 * 5) Reverse order of words
 */
fun getSentenceParts(sentence: String): List<List<String>> {

    // Split the sentence into words
    val words = sentence.split(" ")

    // First letter of each word
    val firstLetters = words.map { it.first().toString() }

    // Last letter of each word
    val lastLetters = words.map { it.last().toString() }

    // All words except the last one
    val wordsExceptLast = words.dropLast(1)

    // All words except the first one
    val wordsExceptFirst = words.drop(1)

    // Reverse order of words
    val reversedWords = words.reversed()

    return listOf(firstLetters, lastLetters, wordsExceptLast, wordsExceptFirst, reversedWords)
}