/**
 * Given a list of firefighters, a list of indices, and a list of elements,
 * this function appends the elements to the respective positions in the
 * firefightersList according to the indices.
 *
 * @param firefightersList List containing firefighters.
 * @param indicesList List containing the indices where the elements will be appended.
 * @param elementsList List containing the elements to append.
 * @return The updated firefightersList.
 */
fun modifyFirefighterList(firefightersList: MutableList<MutableList<String>>, indicesList: List<Int>, elementsList: List<List<String>>): MutableList<MutableList<String>> {

    for ((index, element) in indicesList.zip(elementsList)) {
        firefightersList[index].addAll(element)
    }
    return firefightersList
}
/**
 * Given a list of firefighters, a list of indices, and a list of elements,
 * this function appends the elements to the respective positions in the
 * firefightersList according to the indices.
 *
 * @param firefightersList List containing firefighters.
 * @param indicesList List containing the indices where the elements will be appended.
 * @param elementsList List containing the elements to append.
 * @return The updated firefightersList.
 */
fun modifyFirefighterList(firefightersList: MutableList<MutableList<String>>, indicesList: List<Int>, elementsList: List<List<String>>): MutableList<MutableList<String>> {
/**
 * Given a list of firefighters, a list of indices, and a list of elements,
 * this function appends the elements to the respective positions in the
 * firefightersList according to the indices.
 *
 * @param firefightersList List containing firefighters.
 * @param indicesList List containing the indices where the elements will be appended.
 * @param elementsList List containing the elements to append.
 * @return The updated firefightersList.
 */
fun modifyFirefighterList(firefightersList: MutableList<MutableList<String>>, indicesList: List<Int>, elementsList: List<List<String>>): MutableList<MutableList<String>> {

    for ((index, element) in indicesList.zip(elementsList)) {
        firefightersList[index].addAll(element)
    }
    return firefightersList
}