/**
 * This function takes in a set of symptoms and a threshold value, and returns the count of symptoms that appear in the set more than the threshold times.
 *
 * @param symptomsSet A set of symptoms (strings)
 * @param threshold The minimum number of times a symptom should appear in the set
 * @return The count of symptoms that appear more than the threshold times
 *
 * Example:
 * symptomsSet = setOf("cough", "fever", "headache", "cough", "fatigue")
 * threshold = 1
 * countSymptoms(symptomsSet, threshold) // Output: 2
 */
fun countSymptoms(symptomsSet: Set<String>, threshold: Int): Int {

    val countDict = mutableMapOf<String, Int>() // Map to store the count of each symptom

    for (symptom in symptomsSet) {
        countDict[symptom] = countDict.getOrDefault(symptom, 0) + 1
    }

    var count = 0 // Initialize count of symptoms that meet the threshold

    for ((_, value) in countDict) {
        if (value > threshold) {
            count++
        }
    }

    return count
}
/**
 * This function takes in a set of symptoms and a threshold value, and returns the count of symptoms that appear in the set more than the threshold times.
 *
 * @param symptomsSet A set of symptoms (strings)
 * @param threshold The minimum number of times a symptom should appear in the set
 * @return The count of symptoms that appear more than the threshold times
 *
 * Example:
 * symptomsSet = setOf("cough", "fever", "headache", "cough", "fatigue")
 * threshold = 1
 * countSymptoms(symptomsSet, threshold) // Output: 2
 */
fun countSymptoms(symptomsSet: Set<String>, threshold: Int): Int {
/**
 * This function takes in a set of symptoms and a threshold value, and returns the count of symptoms that appear in the set more than the threshold times.
 *
 * @param symptomsSet A set of symptoms (strings)
 * @param threshold The minimum number of times a symptom should appear in the set
 * @return The count of symptoms that appear more than the threshold times
 *
 * Example:
 * symptomsSet = setOf("cough", "fever", "headache", "cough", "fatigue")
 * threshold = 1
 * countSymptoms(symptomsSet, threshold) // Output: 2
 */
fun countSymptoms(symptomsSet: Set<String>, threshold: Int): Int {

    val countDict = mutableMapOf<String, Int>() // Map to store the count of each symptom

    for (symptom in symptomsSet) {
        countDict[symptom] = countDict.getOrDefault(symptom, 0) + 1
    }

    var count = 0 // Initialize count of symptoms that meet the threshold

    for ((_, value) in countDict) {
        if (value > threshold) {
            count++
        }
    }

    return count
}