/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 First list of integers.
 * @param list2 Second list of integers.
 * @return A list containing the common elements between the two input lists.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Loop through each element in list1
    for (element in list1) {
        // Check if the element is also present in list2
        if (element in list2) {
            // Add the common element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 First list of integers.
 * @param list2 Second list of integers.
 * @return A list containing the common elements between the two input lists.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 First list of integers.
 * @param list2 Second list of integers.
 * @return A list containing the common elements between the two input lists.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Loop through each element in list1
    for (element in list1) {
        // Check if the element is also present in list2
        if (element in list2) {
            // Add the common element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}