/**
 * This exercise is designed to test your understanding of list comprehension and infinite loops.
 * Your task is to complete the code below to find the intersection between names and keywords using list comprehension.
 * However, there is a catch: the program should run an infinite loop until the intersection is found. Can you solve it?
 */
fun intersectionListComprehensionInfiniteLoop(names: List<String>, keywords: List<String>): List<String> {

    var intersection: List<String>
    while (true) {  // Infinite loop
        intersection = names.filter { it in keywords }  // Complete the list comprehension
        if (intersection.isNotEmpty()) {  // If intersection is not empty
            break  // Exit the loop
        }
    }
    return intersection
}
/**
 * This exercise is designed to test your understanding of list comprehension and infinite loops.
 * Your task is to complete the code below to find the intersection between names and keywords using list comprehension.
 * However, there is a catch: the program should run an infinite loop until the intersection is found. Can you solve it?
 */
fun intersectionListComprehensionInfiniteLoop(names: List<String>, keywords: List<String>): List<String> {
/**
 * This exercise is designed to test your understanding of list comprehension and infinite loops.
 * Your task is to complete the code below to find the intersection between names and keywords using list comprehension.
 * However, there is a catch: the program should run an infinite loop until the intersection is found. Can you solve it?
 */
fun intersectionListComprehensionInfiniteLoop(names: List<String>, keywords: List<String>): List<String> {

    var intersection: List<String>
    while (true) {  // Infinite loop
        intersection = names.filter { it in keywords }  // Complete the list comprehension
        if (intersection.isNotEmpty()) {  // If intersection is not empty
            break  // Exit the loop
        }
    }
    return intersection
}