/**
 * Given three sets of game items, return a new set that contains the items that are present in all three sets.
 *
 * @param set1 First set of game items.
 * @param set2 Second set of game items.
 * @param set3 Third set of game items.
 * @return New set containing items present in all three sets.
 *
 * Example:
 * Input:
 * set1 = setOf("sword", "shield", "potion", "boots")
 * set2 = setOf("sword", "book", "ring", "boots")
 * set3 = setOf("sword", "armor", "boots")
 * Output: setOf("sword", "boots")
 */
fun checkItemInMultipleSets(set1: Set<String>, set2: Set<String>, set3: Set<String>): Set<String> {

    // Initialize an empty set to store the common items
    val commonItems = mutableSetOf<String>()

    // Iterate through each item in set1
    for (item in set1) {
        // Check if the item is also present in set2 and set3
        if (item in set2 && item in set3) {
            // If the item is found in all three sets, add it to the commonItems set
            commonItems.add(item)
        }
    }

    return commonItems.toSet()
}
/**
 * Given three sets of game items, return a new set that contains the items that are present in all three sets.
 *
 * @param set1 First set of game items.
 * @param set2 Second set of game items.
 * @param set3 Third set of game items.
 * @return New set containing items present in all three sets.
 *
 * Example:
 * Input:
 * set1 = setOf("sword", "shield", "potion", "boots")
 * set2 = setOf("sword", "book", "ring", "boots")
 * set3 = setOf("sword", "armor", "boots")
 * Output: setOf("sword", "boots")
 */
fun checkItemInMultipleSets(set1: Set<String>, set2: Set<String>, set3: Set<String>): Set<String> {
/**
 * Given three sets of game items, return a new set that contains the items that are present in all three sets.
 *
 * @param set1 First set of game items.
 * @param set2 Second set of game items.
 * @param set3 Third set of game items.
 * @return New set containing items present in all three sets.
 *
 * Example:
 * Input:
 * set1 = setOf("sword", "shield", "potion", "boots")
 * set2 = setOf("sword", "book", "ring", "boots")
 * set3 = setOf("sword", "armor", "boots")
 * Output: setOf("sword", "boots")
 */
fun checkItemInMultipleSets(set1: Set<String>, set2: Set<String>, set3: Set<String>): Set<String> {

    // Initialize an empty set to store the common items
    val commonItems = mutableSetOf<String>()

    // Iterate through each item in set1
    for (item in set1) {
        // Check if the item is also present in set2 and set3
        if (item in set2 && item in set3) {
            // If the item is found in all three sets, add it to the commonItems set
            commonItems.add(item)
        }
    }

    return commonItems.toSet()
}