/**
 * Given two lists of elements and sub-elements, this function finds the intersection
 * of all the sub-elements with their respective elements using a while loop and the 'in' operator.
 *
 * @param elements A list of elements.
 * @param subElements A list of sub-elements.
 * @return The intersection of the sub-elements with their respective elements.
 */
fun intersectionLoopOperator(elements: List<String>, subElements: List<String>): List<String> {

    val result = mutableListOf<String>()

    var i = 0
    while (i < elements.size) {
        if (subElements[i] in elements[i]) {
            result.add(subElements[i])
        }
        i++
    }

    return result
}
/**
 * Given two lists of elements and sub-elements, this function finds the intersection
 * of all the sub-elements with their respective elements using a while loop and the 'in' operator.
 *
 * @param elements A list of elements.
 * @param subElements A list of sub-elements.
 * @return The intersection of the sub-elements with their respective elements.
 */
fun intersectionLoopOperator(elements: List<String>, subElements: List<String>): List<String> {
/**
 * Given two lists of elements and sub-elements, this function finds the intersection
 * of all the sub-elements with their respective elements using a while loop and the 'in' operator.
 *
 * @param elements A list of elements.
 * @param subElements A list of sub-elements.
 * @return The intersection of the sub-elements with their respective elements.
 */
fun intersectionLoopOperator(elements: List<String>, subElements: List<String>): List<String> {

    val result = mutableListOf<String>()

    var i = 0
    while (i < elements.size) {
        if (subElements[i] in elements[i]) {
            result.add(subElements[i])
        }
        i++
    }

    return result
}