/**
 * This function takes two lists as input and returns a new list containing the common elements present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list containing the common elements between list1 and list2
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [3, 4]
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()
    for (element in list1) {
        if (element in list2) {
            commonElements.add(element)
        }
    }
    return commonElements
}
/**
 * This function takes two lists as input and returns a new list containing the common elements present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list containing the common elements between list1 and list2
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [3, 4]
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes two lists as input and returns a new list containing the common elements present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A list containing the common elements between list1 and list2
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [3, 4]
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

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