/**
 * Given a list of words, change the case of each word based on the given case option.
 *
 * @param words A list of words.
 * @param case A string representing the case option.
 *             'U' for converting to uppercase.
 *             'L' for converting to lowercase.
 * @return A list with modified case of each word based on the case option.
 */
fun changeCaseInList(words: List<String>, case: String): List<String> {

    val modifiedWords = mutableListOf<String>()

    for (word in words) {
        val modifiedWord = when (case) {
            "U" -> word.toUpperCase()
            "L" -> word.toLowerCase()
            else -> ""
        }

        modifiedWords.add(modifiedWord)
    }

    return modifiedWords
}
/**
 * Given a list of words, change the case of each word based on the given case option.
 *
 * @param words A list of words.
 * @param case A string representing the case option.
 *             'U' for converting to uppercase.
 *             'L' for converting to lowercase.
 * @return A list with modified case of each word based on the case option.
 */
fun changeCaseInList(words: List<String>, case: String): List<String> {
/**
 * Given a list of words, change the case of each word based on the given case option.
 *
 * @param words A list of words.
 * @param case A string representing the case option.
 *             'U' for converting to uppercase.
 *             'L' for converting to lowercase.
 * @return A list with modified case of each word based on the case option.
 */
fun changeCaseInList(words: List<String>, case: String): List<String> {

    val modifiedWords = mutableListOf<String>()

    for (word in words) {
        val modifiedWord = when (case) {
            "U" -> word.toUpperCase()
            "L" -> word.toLowerCase()
            else -> ""
        }

        modifiedWords.add(modifiedWord)
    }

    return modifiedWords
}