/**
 * Given a list of photos and a list of filters, apply each filter to every photo using list comprehensions.
 *
 * @param photos A list of strings representing the file names of the photos.
 * @param filters A list of strings representing the filters to be applied.
 * @return A list of strings containing the modified file names of the photos after applying the filters.
 *
 * Example:
 * photos = ['photo1.jpg', 'photo2.jpg', 'photo3.jpg']
 * filters = ['sepia', 'black_and_white']
 * modifyPhotos(photos, filters) =>
 * ['photo1_sepia.jpg', 'photo2_sepia.jpg', 'photo3_sepia.jpg', 'photo1_black_and_white.jpg',
 * 'photo2_black_and_white.jpg', 'photo3_black_and_white.jpg']
 */
fun modifyPhotos(photos: List<String>, filters: List<String>): List<String> {

    // Use list comprehension to modify each photo by appending the filter name
    val modifiedPhotos = photos.flatMap { photo ->
        filters.map { filter ->
            "${photo.split('.')[0]}_$filter.${photo.split('.')[1]}"
        }
    }
    return modifiedPhotos
}
/**
 * Given a list of photos and a list of filters, apply each filter to every photo using list comprehensions.
 *
 * @param photos A list of strings representing the file names of the photos.
 * @param filters A list of strings representing the filters to be applied.
 * @return A list of strings containing the modified file names of the photos after applying the filters.
 *
 * Example:
 * photos = ['photo1.jpg', 'photo2.jpg', 'photo3.jpg']
 * filters = ['sepia', 'black_and_white']
 * modifyPhotos(photos, filters) =>
 * ['photo1_sepia.jpg', 'photo2_sepia.jpg', 'photo3_sepia.jpg', 'photo1_black_and_white.jpg',
 * 'photo2_black_and_white.jpg', 'photo3_black_and_white.jpg']
 */
fun modifyPhotos(photos: List<String>, filters: List<String>): List<String> {
/**
 * Given a list of photos and a list of filters, apply each filter to every photo using list comprehensions.
 *
 * @param photos A list of strings representing the file names of the photos.
 * @param filters A list of strings representing the filters to be applied.
 * @return A list of strings containing the modified file names of the photos after applying the filters.
 *
 * Example:
 * photos = ['photo1.jpg', 'photo2.jpg', 'photo3.jpg']
 * filters = ['sepia', 'black_and_white']
 * modifyPhotos(photos, filters) =>
 * ['photo1_sepia.jpg', 'photo2_sepia.jpg', 'photo3_sepia.jpg', 'photo1_black_and_white.jpg',
 * 'photo2_black_and_white.jpg', 'photo3_black_and_white.jpg']
 */
fun modifyPhotos(photos: List<String>, filters: List<String>): List<String> {

    // Use list comprehension to modify each photo by appending the filter name
    val modifiedPhotos = photos.flatMap { photo ->
        filters.map { filter ->
            "${photo.split('.')[0]}_$filter.${photo.split('.')[1]}"
        }
    }
    return modifiedPhotos
}