/**
 * This function takes in the information of a firefighter and formats it into a string.
 *
 * @param name The name of the firefighter.
 * @param age The age of the firefighter.
 * @param experience A nested tuple containing information about the firefighter's experience.
 * @param address A nested tuple containing address details.
 * @param salary The salary of the firefighter.
 * @return A formatted string displaying the information of the firefighter.
 */
fun formatFirefighterInfo(name: String, age: Int, experience: List<Pair<Int, String>>, address: List<Triple<String, String, String>>, salary: Double): String {

    val experienceStr = experience.joinToString(", ") { (years, position) -> "$years years in $position" }
    val addressStr = address.joinToString(" - ") { (street, city, pincode) -> "$street, $city, $pincode" }

    return "Name: $name\nAge: $age\nExperience: $experienceStr\nAddress: $addressStr\nSalary: $${"%.2f".format(salary)}"
}
/**
 * This function takes in the information of a firefighter and formats it into a string.
 *
 * @param name The name of the firefighter.
 * @param age The age of the firefighter.
 * @param experience A nested tuple containing information about the firefighter's experience.
 * @param address A nested tuple containing address details.
 * @param salary The salary of the firefighter.
 * @return A formatted string displaying the information of the firefighter.
 */
fun formatFirefighterInfo(name: String, age: Int, experience: List<Pair<Int, String>>, address: List<Triple<String, String, String>>, salary: Double): String {
/**
 * This function takes in the information of a firefighter and formats it into a string.
 *
 * @param name The name of the firefighter.
 * @param age The age of the firefighter.
 * @param experience A nested tuple containing information about the firefighter's experience.
 * @param address A nested tuple containing address details.
 * @param salary The salary of the firefighter.
 * @return A formatted string displaying the information of the firefighter.
 */
fun formatFirefighterInfo(name: String, age: Int, experience: List<Pair<Int, String>>, address: List<Triple<String, String, String>>, salary: Double): String {

    val experienceStr = experience.joinToString(", ") { (years, position) -> "$years years in $position" }
    val addressStr = address.joinToString(" - ") { (street, city, pincode) -> "$street, $city, $pincode" }

    return "Name: $name\nAge: $age\nExperience: $experienceStr\nAddress: $addressStr\nSalary: $${"%.2f".format(salary)}"
}