/**
 * Given two lists, return a new list containing common elements between them.
 *
 * @param l1 The first list.
 * @param l2 The second list.
 * @return A new list containing common elements.
 *
 * Example:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun getCommonElements(l1: List<Int>, l2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in l1) {
        if (element in l2) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Given two lists, return a new list containing common elements between them.
 *
 * @param l1 The first list.
 * @param l2 The second list.
 * @return A new list containing common elements.
 *
 * Example:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun getCommonElements(l1: List<Int>, l2: List<Int>): List<Int> {
/**
 * Given two lists, return a new list containing common elements between them.
 *
 * @param l1 The first list.
 * @param l2 The second list.
 * @return A new list containing common elements.
 *
 * Example:
 * getCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 */
fun getCommonElements(l1: List<Int>, l2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in l1) {
        if (element in l2) {
            commonElements.add(element)
        }
    }

    return commonElements
}