/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 First list (contains integers)
 * @param list2 Second list (contains integers)
 * @return List containing the common elements found in both lists
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in list1) {
        if (element in list2 && element !in commonElements) {
            commonElements.add(element)
        }
    }

    return commonElements
}

// Example usage
/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 First list (contains integers)
 * @param list2 Second list (contains integers)
 * @return List containing the common elements found in both lists
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, find the common elements between them.
 *
 * @param list1 First list (contains integers)
 * @param list2 Second list (contains integers)
 * @return List containing the common elements found in both lists
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    for (element in list1) {
        if (element in list2 && element !in commonElements) {
            commonElements.add(element)
        }
    }

    return commonElements
}

// Example usage