/**
 * This function calculates the number of patients above a given threshold value.
 * The patientData parameter is a list of dictionaries containing patient information
 * such as name, age, and health score.
 *
 * @param threshold The minimum health score threshold.
 * @param patientData A list of dictionaries containing patient information.
 * @return The total count of patients whose health score is greater than or equal to the threshold.
 */
fun calculatePatientsAboveThreshold(threshold: Int, patientData: List<Map<String, Any>>): Int {

    var count = 0
    var index = 0

    while (index < patientData.size) {
        val healthScore = patientData[index]["health_score"] as Int
        // write code to compare the healthScore with threshold
        // and increment the count if the condition is satisfied
        // Remember, greater than or equal to threshold

        if (healthScore >= threshold) {
            count++
        }

        index++
    }

    return count
}
/**
 * This function calculates the number of patients above a given threshold value.
 * The patientData parameter is a list of dictionaries containing patient information
 * such as name, age, and health score.
 *
 * @param threshold The minimum health score threshold.
 * @param patientData A list of dictionaries containing patient information.
 * @return The total count of patients whose health score is greater than or equal to the threshold.
 */
fun calculatePatientsAboveThreshold(threshold: Int, patientData: List<Map<String, Any>>): Int {
/**
 * This function calculates the number of patients above a given threshold value.
 * The patientData parameter is a list of dictionaries containing patient information
 * such as name, age, and health score.
 *
 * @param threshold The minimum health score threshold.
 * @param patientData A list of dictionaries containing patient information.
 * @return The total count of patients whose health score is greater than or equal to the threshold.
 */
fun calculatePatientsAboveThreshold(threshold: Int, patientData: List<Map<String, Any>>): Int {

    var count = 0
    var index = 0

    while (index < patientData.size) {
        val healthScore = patientData[index]["health_score"] as Int
        // write code to compare the healthScore with threshold
        // and increment the count if the condition is satisfied
        // Remember, greater than or equal to threshold

        if (healthScore >= threshold) {
            count++
        }

        index++
    }

    return count
}