/**
 * Given two lists, find the intersection of the lists using the 'in' operator.
 *
 * @param lst1 The first list.
 * @param lst2 The second list.
 * @return A list containing the common elements between lst1 and lst2.
 *
 * Example:
 * listIntersection(listOf(1, 2, 3), listOf(2, 3, 4)) // [2, 3]
 */
fun listIntersection(lst1: List<Int>, lst2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    for (element in lst1) {
        // Check if element is present in both lst1 and lst2 using 'in' operator
        if (element in lst2 && element !in intersection) {
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * Given two lists, find the intersection of the lists using the 'in' operator.
 *
 * @param lst1 The first list.
 * @param lst2 The second list.
 * @return A list containing the common elements between lst1 and lst2.
 *
 * Example:
 * listIntersection(listOf(1, 2, 3), listOf(2, 3, 4)) // [2, 3]
 */
fun listIntersection(lst1: List<Int>, lst2: List<Int>): List<Int> {
/**
 * Given two lists, find the intersection of the lists using the 'in' operator.
 *
 * @param lst1 The first list.
 * @param lst2 The second list.
 * @return A list containing the common elements between lst1 and lst2.
 *
 * Example:
 * listIntersection(listOf(1, 2, 3), listOf(2, 3, 4)) // [2, 3]
 */
fun listIntersection(lst1: List<Int>, lst2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    for (element in lst1) {
        // Check if element is present in both lst1 and lst2 using 'in' operator
        if (element in lst2 && element !in intersection) {
            intersection.add(element)
        }
    }

    return intersection
}