/**
 * This function takes in two lists as input and finds the common elements between them.
 * The common elements will be returned as a new list.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

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

    // Iterate through each element in the first list
    for (num1 in list1) {
        // Iterate through each element in the second list
        for (num2 in list2) {
            // Check if the current element from the first list is equal to the current element from the second list
            if (num1 == num2) {
                // Add the common element to the commonElements list
                commonElements.add(num1)
                // Break out of the inner loop (we have found a common element, no need to continue checking)
                break
            }
        }
    }

    // Return the list of common elements
    return commonElements
}
/**
 * This function takes in two lists as input and finds the common elements between them.
 * The common elements will be returned as a new list.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes in two lists as input and finds the common elements between them.
 * The common elements will be returned as a new list.
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

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

    // Iterate through each element in the first list
    for (num1 in list1) {
        // Iterate through each element in the second list
        for (num2 in list2) {
            // Check if the current element from the first list is equal to the current element from the second list
            if (num1 == num2) {
                // Add the common element to the commonElements list
                commonElements.add(num1)
                // Break out of the inner loop (we have found a common element, no need to continue checking)
                break
            }
        }
    }

    // Return the list of common elements
    return commonElements
}