/**
 * Given two texts, this function finds the common words between them.
 *
 * @param text1 The first text
 * @param text2 The second text
 * @return A list of common words between the two texts
 */
fun findCommonWords(text1: String, text2: String): List<String> {

    // Converting the texts to lowercase and splitting them into words
    val wordsText1 = text1.toLowerCase().split(" ")
    val wordsText2 = text2.toLowerCase().split(" ")

    // Finding the intersection of words using sets
    val commonWords = wordsText1.intersect(wordsText2).toList()

    return commonWords
}
/**
 * Given two texts, this function finds the common words between them.
 *
 * @param text1 The first text
 * @param text2 The second text
 * @return A list of common words between the two texts
 */
fun findCommonWords(text1: String, text2: String): List<String> {
/**
 * Given two texts, this function finds the common words between them.
 *
 * @param text1 The first text
 * @param text2 The second text
 * @return A list of common words between the two texts
 */
fun findCommonWords(text1: String, text2: String): List<String> {

    // Converting the texts to lowercase and splitting them into words
    val wordsText1 = text1.toLowerCase().split(" ")
    val wordsText2 = text2.toLowerCase().split(" ")

    // Finding the intersection of words using sets
    val commonWords = wordsText1.intersect(wordsText2).toList()

    return commonWords
}