/**
 * Suppose an archaeologist has two lists of artifacts, list1 and list2. Write a function that finds the common elements in both lists.
 *
 * @param list1 A list containing artifacts found at a particular excavation site.
 * @param list2 A list containing artifacts found at another excavation site.
 * @return A list of common artifacts found in both excavation sites.
 *
 * 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 (artifact1 in list1) {
        for (artifact2 in list2) {
            if (artifact1 == artifact2) {
                commonElements.add(artifact1)
            }
        }
    }

    return commonElements
}
/**
 * Suppose an archaeologist has two lists of artifacts, list1 and list2. Write a function that finds the common elements in both lists.
 *
 * @param list1 A list containing artifacts found at a particular excavation site.
 * @param list2 A list containing artifacts found at another excavation site.
 * @return A list of common artifacts found in both excavation sites.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [3, 4]
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Suppose an archaeologist has two lists of artifacts, list1 and list2. Write a function that finds the common elements in both lists.
 *
 * @param list1 A list containing artifacts found at a particular excavation site.
 * @param list2 A list containing artifacts found at another excavation site.
 * @return A list of common artifacts found in both excavation sites.
 *
 * 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 (artifact1 in list1) {
        for (artifact2 in list2) {
            if (artifact1 == artifact2) {
                commonElements.add(artifact1)
            }
        }
    }

    return commonElements
}