/**
 * This function takes in a set of items and returns the number of times a specific item appears in the set.
 *
 * @param itemSet A set of items
 * @param item The item to count
 * @return The number of times the item appears in the set
 */
fun countItemsInSet(itemSet: Set<String>, item: String): Int {

    var count = 0
    val iterator = itemSet.iterator()
    while (true) {
        try {
            val currentItem = iterator.next()
            // --------------- YOUR CODE STARTS HERE ---------------
            if (currentItem == item) {
                count++
            }
            // ---------------- YOUR CODE ENDS HERE ----------------
        } catch (e: NoSuchElementException) {
            break
        }
    }
    return count
}
/**
 * This function takes in a set of items and returns the number of times a specific item appears in the set.
 *
 * @param itemSet A set of items
 * @param item The item to count
 * @return The number of times the item appears in the set
 */
fun countItemsInSet(itemSet: Set<String>, item: String): Int {
/**
 * This function takes in a set of items and returns the number of times a specific item appears in the set.
 *
 * @param itemSet A set of items
 * @param item The item to count
 * @return The number of times the item appears in the set
 */
fun countItemsInSet(itemSet: Set<String>, item: String): Int {

    var count = 0
    val iterator = itemSet.iterator()
    while (true) {
        try {
            val currentItem = iterator.next()
            // --------------- YOUR CODE STARTS HERE ---------------
            if (currentItem == item) {
                count++
            }
            // ---------------- YOUR CODE ENDS HERE ----------------
        } catch (e: NoSuchElementException) {
            break
        }
    }
    return count
}