/**
 * Given two lists, this function finds and returns the common elements present in both lists.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Int>()

    // Iterate over the elements in the first list
    for (element in list1) {
        // Check if the element is also present in the second list
        if (element in list2) {
            // Add the common element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Given two lists, this function finds and returns the common elements present in both lists.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, this function finds and returns the common elements present in both lists.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Int>()

    // Iterate over the elements in the first list
    for (element in list1) {
        // Check if the element is also present in the second list
        if (element in list2) {
            // Add the common element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}