/**
 * The function intersection takes in two lists, a and b,
 * and returns a new list containing the elements that are common
 * to both lists.
 *
 * Example:
 * a = [1, 2, 3, 4, 5]
 * b = [4, 5, 6, 7]
 * intersection(a, b) -> [4, 5]
 */
fun intersection(a: List<Int>, b: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in a) {
        if (element in b) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * The function intersection takes in two lists, a and b,
 * and returns a new list containing the elements that are common
 * to both lists.
 *
 * Example:
 * a = [1, 2, 3, 4, 5]
 * b = [4, 5, 6, 7]
 * intersection(a, b) -> [4, 5]
 */
fun intersection(a: List<Int>, b: List<Int>): List<Int> {
/**
 * The function intersection takes in two lists, a and b,
 * and returns a new list containing the elements that are common
 * to both lists.
 *
 * Example:
 * a = [1, 2, 3, 4, 5]
 * b = [4, 5, 6, 7]
 * intersection(a, b) -> [4, 5]
 */
fun intersection(a: List<Int>, b: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in a) {
        if (element in b) {
            commonElements.add(element)
        }
    }

    return commonElements
}