/**
 * This function takes two lists as input and returns a set containing the common items between them.
 *
 * Example:
 * findCommonItems(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: [3, 4]
 */
fun findCommonItems(list1: List<Int>, list2: List<Int>): Set<Int> {

    val commonItems = mutableSetOf<Int>()
    // Iterate over each item in list1
    for (item in list1) {
        // Check if the item is present in list2
        if (item in list2) {
            // If item is common to both lists, add it to the commonItems set
            commonItems.add(item)
        }
    }
    return commonItems
}
/**
 * This function takes two lists as input and returns a set containing the common items between them.
 *
 * Example:
 * findCommonItems(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: [3, 4]
 */
fun findCommonItems(list1: List<Int>, list2: List<Int>): Set<Int> {
/**
 * This function takes two lists as input and returns a set containing the common items between them.
 *
 * Example:
 * findCommonItems(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: [3, 4]
 */
fun findCommonItems(list1: List<Int>, list2: List<Int>): Set<Int> {

    val commonItems = mutableSetOf<Int>()
    // Iterate over each item in list1
    for (item in list1) {
        // Check if the item is present in list2
        if (item in list2) {
            // If item is common to both lists, add it to the commonItems set
            commonItems.add(item)
        }
    }
    return commonItems
}