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

    val commonElements = mutableListOf<Int>()

    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break
            }
        }
    }

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

    val commonElements = mutableListOf<Int>()

    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break
            }
        }
    }

    return commonElements
}