/**
 * Given a list of substrings and a list of words, find the intersection between them and return as a new list.
 */
fun findIntersection(substrings: List<String>, words: List<String>): List<String> {

    val intersection = mutableListOf<String>()
    for (substring in substrings) {
        if (substring in words) {
            intersection.add(substring)
        }
    }
    return intersection
}
/**
 * Given a list of substrings and a list of words, find the intersection between them and return as a new list.
 */
fun findIntersection(substrings: List<String>, words: List<String>): List<String> {
/**
 * Given a list of substrings and a list of words, find the intersection between them and return as a new list.
 */
fun findIntersection(substrings: List<String>, words: List<String>): List<String> {

    val intersection = mutableListOf<String>()
    for (substring in substrings) {
        if (substring in words) {
            intersection.add(substring)
        }
    }
    return intersection
}