/**
 * This function returns a list of firefighters with a specified rank.
 *
 * @param firefighters A list of dictionaries containing information about firefighters.
 * @param rank The rank to search for.
 * @return A list of firefighters with the specified rank.
 */
fun getFirefighterRank(firefighters: List<Map<String, String>>, rank: String): List<Map<String, String>> {

    // Initialize an empty list to store the matching firefighters
    val matchingFirefighters = mutableListOf<Map<String, String>>()

    // Iterate through each firefighter in the list
    for (firefighter in firefighters) {
        // Check if the firefighter's rank matches the specified rank
        if (firefighter["rank"] == rank) {
            // Append the firefighter to the matchingFirefighters list
            matchingFirefighters.add(firefighter)
        }
    }

    return matchingFirefighters
}
/**
 * This function returns a list of firefighters with a specified rank.
 *
 * @param firefighters A list of dictionaries containing information about firefighters.
 * @param rank The rank to search for.
 * @return A list of firefighters with the specified rank.
 */
fun getFirefighterRank(firefighters: List<Map<String, String>>, rank: String): List<Map<String, String>> {
/**
 * This function returns a list of firefighters with a specified rank.
 *
 * @param firefighters A list of dictionaries containing information about firefighters.
 * @param rank The rank to search for.
 * @return A list of firefighters with the specified rank.
 */
fun getFirefighterRank(firefighters: List<Map<String, String>>, rank: String): List<Map<String, String>> {

    // Initialize an empty list to store the matching firefighters
    val matchingFirefighters = mutableListOf<Map<String, String>>()

    // Iterate through each firefighter in the list
    for (firefighter in firefighters) {
        // Check if the firefighter's rank matches the specified rank
        if (firefighter["rank"] == rank) {
            // Append the firefighter to the matchingFirefighters list
            matchingFirefighters.add(firefighter)
        }
    }

    return matchingFirefighters
}