/**
 * This exercise requires the firefighter to find the intersection of two lists using nested loops and slicing.
 * The firefighter needs to complete the code to return a new list containing the common elements between listA and listB.
 */
fun sliceIntersection(listA: List<Int>, listB: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (a in listA) {
        for (b in listB) {
            // Check if the current element in listA also exists in listB
            if (a == b) {
                // Add the common element to the commonElements list
                commonElements.add(a)
            }
        }
    }

    return commonElements
}
/**
 * This exercise requires the firefighter to find the intersection of two lists using nested loops and slicing.
 * The firefighter needs to complete the code to return a new list containing the common elements between listA and listB.
 */
fun sliceIntersection(listA: List<Int>, listB: List<Int>): List<Int> {
/**
 * This exercise requires the firefighter to find the intersection of two lists using nested loops and slicing.
 * The firefighter needs to complete the code to return a new list containing the common elements between listA and listB.
 */
fun sliceIntersection(listA: List<Int>, listB: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (a in listA) {
        for (b in listB) {
            // Check if the current element in listA also exists in listB
            if (a == b) {
                // Add the common element to the commonElements list
                commonElements.add(a)
            }
        }
    }

    return commonElements
}