/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (element in list1) {
        for (num in list2.indices) {
            if (element == list2[num]) {
                commonElements.add(element)
                break
            }
        }
    }
    return commonElements
}
/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list containing the common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (element in list1) {
        for (num in list2.indices) {
            if (element == list2[num]) {
                commonElements.add(element)
                break
            }
        }
    }
    return commonElements
}