/**
 * Given an input string containing multiple words and numbers, return a list containing only the words
 * that have a length less than the target number.
 *
 * @param inputString A string containing words and numbers separated by spaces.
 * @param target An integer representing the length threshold for word selection.
 * @return A list of strings containing only the words with length less than the target.
 */
fun findWordsLessThan(inputString: String, target: Int): List<String> {

    val words = inputString.split(" ")  // Split the input string into individual words
    val selectedWords = mutableListOf<String>()  // List to store the selected words

    for (word in words) {
        if (word.all { it.isLetter() } && word.length < target) {
            selectedWords.add(word)  // Only consider words (no numbers) with length less than the target
        }
    }

    return selectedWords  // Return the selected words as a list
}
/**
 * Given an input string containing multiple words and numbers, return a list containing only the words
 * that have a length less than the target number.
 *
 * @param inputString A string containing words and numbers separated by spaces.
 * @param target An integer representing the length threshold for word selection.
 * @return A list of strings containing only the words with length less than the target.
 */
fun findWordsLessThan(inputString: String, target: Int): List<String> {
/**
 * Given an input string containing multiple words and numbers, return a list containing only the words
 * that have a length less than the target number.
 *
 * @param inputString A string containing words and numbers separated by spaces.
 * @param target An integer representing the length threshold for word selection.
 * @return A list of strings containing only the words with length less than the target.
 */
fun findWordsLessThan(inputString: String, target: Int): List<String> {

    val words = inputString.split(" ")  // Split the input string into individual words
    val selectedWords = mutableListOf<String>()  // List to store the selected words

    for (word in words) {
        if (word.all { it.isLetter() } && word.length < target) {
            selectedWords.add(word)  // Only consider words (no numbers) with length less than the target
        }
    }

    return selectedWords  // Return the selected words as a list
}