/**
 * You are a photographer who wants to add a watermark to your photos.
 * Given a map 'photos' where the keys are the photo filenames and the values are the corresponding photo ratings,
 * and a string 'watermark' representing the watermark text, write a function that adds the watermark to each photo by
 * appending the watermark text to the filename.
 *
 * Example:
 *
 * photos = mapOf(
 *     "photo1.jpg" to 4,
 *     "photo2.jpg" to 5,
 *     "photo3.jpg" to 3
 * )
 *
 * watermark = "COPYRIGHT"
 *
 * addWatermark(photos, watermark)
 *
 * Output:
 *
 * mapOf(
 *     "photo1.jpg COPYRIGHT" to 4,
 *     "photo2.jpg COPYRIGHT" to 5,
 *     "photo3.jpg COPYRIGHT" to 3
 * )
 */
fun addWatermark(photos: MutableMap<String, Int>, watermark: String): Map<String, Int> {

    // Iterate over each photo in the map
    for ((photo, rating) in photos.toList()) {
        // Append the watermark to the filename
        photos.remove(photo)
        photos["$photo $watermark"] = rating
    }
    return photos
}
/**
 * You are a photographer who wants to add a watermark to your photos.
 * Given a map 'photos' where the keys are the photo filenames and the values are the corresponding photo ratings,
 * and a string 'watermark' representing the watermark text, write a function that adds the watermark to each photo by
 * appending the watermark text to the filename.
 *
 * Example:
 *
 * photos = mapOf(
 *     "photo1.jpg" to 4,
 *     "photo2.jpg" to 5,
 *     "photo3.jpg" to 3
 * )
 *
 * watermark = "COPYRIGHT"
 *
 * addWatermark(photos, watermark)
 *
 * Output:
 *
 * mapOf(
 *     "photo1.jpg COPYRIGHT" to 4,
 *     "photo2.jpg COPYRIGHT" to 5,
 *     "photo3.jpg COPYRIGHT" to 3
 * )
 */
fun addWatermark(photos: MutableMap<String, Int>, watermark: String): Map<String, Int> {
/**
 * You are a photographer who wants to add a watermark to your photos.
 * Given a map 'photos' where the keys are the photo filenames and the values are the corresponding photo ratings,
 * and a string 'watermark' representing the watermark text, write a function that adds the watermark to each photo by
 * appending the watermark text to the filename.
 *
 * Example:
 *
 * photos = mapOf(
 *     "photo1.jpg" to 4,
 *     "photo2.jpg" to 5,
 *     "photo3.jpg" to 3
 * )
 *
 * watermark = "COPYRIGHT"
 *
 * addWatermark(photos, watermark)
 *
 * Output:
 *
 * mapOf(
 *     "photo1.jpg COPYRIGHT" to 4,
 *     "photo2.jpg COPYRIGHT" to 5,
 *     "photo3.jpg COPYRIGHT" to 3
 * )
 */
fun addWatermark(photos: MutableMap<String, Int>, watermark: String): Map<String, Int> {

    // Iterate over each photo in the map
    for ((photo, rating) in photos.toList()) {
        // Append the watermark to the filename
        photos.remove(photo)
        photos["$photo $watermark"] = rating
    }
    return photos
}