/**
 * This function takes a list of words 'wordList' and a query string 'query',
 * and returns a list of words from 'wordList' that contain any of the characters in 'query'.
 *
 * @param wordList a list of words to search through
 * @param query a string containing characters to search for
 * @return a list of words that contain any of the characters in 'query'
 *
 * Example:
 * findMatchingWord(listOf("hello", "world", "python", "programming"), "or")
 * Output: ['world', 'python', 'programming']
 */
fun findMatchingWord(wordList: List<String>, query: String): List<String> {

    val matchingWords = mutableListOf<String>()
    for (word in wordList) {
        for (char in query) {
            if (word.contains(char)) {
                matchingWords.add(word)
                break
            }
        }
    }
    return matchingWords
}
/**
 * This function takes a list of words 'wordList' and a query string 'query',
 * and returns a list of words from 'wordList' that contain any of the characters in 'query'.
 *
 * @param wordList a list of words to search through
 * @param query a string containing characters to search for
 * @return a list of words that contain any of the characters in 'query'
 *
 * Example:
 * findMatchingWord(listOf("hello", "world", "python", "programming"), "or")
 * Output: ['world', 'python', 'programming']
 */
fun findMatchingWord(wordList: List<String>, query: String): List<String> {
/**
 * This function takes a list of words 'wordList' and a query string 'query',
 * and returns a list of words from 'wordList' that contain any of the characters in 'query'.
 *
 * @param wordList a list of words to search through
 * @param query a string containing characters to search for
 * @return a list of words that contain any of the characters in 'query'
 *
 * Example:
 * findMatchingWord(listOf("hello", "world", "python", "programming"), "or")
 * Output: ['world', 'python', 'programming']
 */
fun findMatchingWord(wordList: List<String>, query: String): List<String> {

    val matchingWords = mutableListOf<String>()
    for (word in wordList) {
        for (char in query) {
            if (word.contains(char)) {
                matchingWords.add(word)
                break
            }
        }
    }
    return matchingWords
}