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

    val commonElements = mutableListOf<Int>()

    for (item1 in list1) {
        for (item2 in list2) {
            if (item1 == item2) {
                commonElements.add(item1)
                break
            }
        }
    }

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

    val commonElements = mutableListOf<Int>()

    for (item1 in list1) {
        for (item2 in list2) {
            if (item1 == item2) {
                commonElements.add(item1)
                break
            }
        }
    }

    return commonElements
}