/**
 * This function takes a list of photographers and their works, and appends new elements to it based on a nested loop.
 *
 * @param photographerList A list containing photographer names and their works.
 * @return The updated photographer list with the appended elements.
 */
fun appendElements(photographerList: MutableList<Pair<String, String>>): MutableList<Pair<String, String>> {

    for (i in photographerList.indices) {
        // Get the current photographer name from the list
        val photographer = photographerList[i].first

        // Nested loop to append new elements
        for (j in i until photographerList.size) {
            // Get the current work of the photographer
            val work = photographerList[j].second

            // Generate a new element based on the current photographer and work
            val newElement = "$photographer - $work"

            // Append the new element to the list
            photographerList.add(Pair(photographer, newElement))
        }
    }

    return photographerList
}
/**
 * This function takes a list of photographers and their works, and appends new elements to it based on a nested loop.
 *
 * @param photographerList A list containing photographer names and their works.
 * @return The updated photographer list with the appended elements.
 */
fun appendElements(photographerList: MutableList<Pair<String, String>>): MutableList<Pair<String, String>> {
/**
 * This function takes a list of photographers and their works, and appends new elements to it based on a nested loop.
 *
 * @param photographerList A list containing photographer names and their works.
 * @return The updated photographer list with the appended elements.
 */
fun appendElements(photographerList: MutableList<Pair<String, String>>): MutableList<Pair<String, String>> {

    for (i in photographerList.indices) {
        // Get the current photographer name from the list
        val photographer = photographerList[i].first

        // Nested loop to append new elements
        for (j in i until photographerList.size) {
            // Get the current work of the photographer
            val work = photographerList[j].second

            // Generate a new element based on the current photographer and work
            val newElement = "$photographer - $work"

            // Append the new element to the list
            photographerList.add(Pair(photographer, newElement))
        }
    }

    return photographerList
}