/**
 * Write a function that takes a name and a map of cases and returns the case number associated with that name.
 *
 * @param name The name of a person.
 * @param cases A map where the keys are case numbers and the values are names.
 * @return The case number associated with the given name, or null if not found.
 *
 * Example:
 * findCaseNumber("John Doe", mapOf(1234 to "John Doe", 5678 to "Jane Smith", 9876 to "Michael Johnson"))
 * Output: 1234
 */
fun findCaseNumber(name: String, cases: Map<Int, String>): Int? {

    // Iterate over each case number and name in the map
    for ((caseNumber, personName) in cases) {
        // Check if the given name matches the person's name in the current case
        if (personName == name) {
            // Return the case number
            return caseNumber
        }
    }
    // If no matching case number is found, return null
    return null
}
/**
 * Write a function that takes a name and a map of cases and returns the case number associated with that name.
 *
 * @param name The name of a person.
 * @param cases A map where the keys are case numbers and the values are names.
 * @return The case number associated with the given name, or null if not found.
 *
 * Example:
 * findCaseNumber("John Doe", mapOf(1234 to "John Doe", 5678 to "Jane Smith", 9876 to "Michael Johnson"))
 * Output: 1234
 */
fun findCaseNumber(name: String, cases: Map<Int, String>): Int? {
/**
 * Write a function that takes a name and a map of cases and returns the case number associated with that name.
 *
 * @param name The name of a person.
 * @param cases A map where the keys are case numbers and the values are names.
 * @return The case number associated with the given name, or null if not found.
 *
 * Example:
 * findCaseNumber("John Doe", mapOf(1234 to "John Doe", 5678 to "Jane Smith", 9876 to "Michael Johnson"))
 * Output: 1234
 */
fun findCaseNumber(name: String, cases: Map<Int, String>): Int? {

    // Iterate over each case number and name in the map
    for ((caseNumber, personName) in cases) {
        // Check if the given name matches the person's name in the current case
        if (personName == name) {
            // Return the case number
            return caseNumber
        }
    }
    // If no matching case number is found, return null
    return null
}