/**
 * This function takes a filename and an album as input and returns the index of the photo with the given filename
 * in the album. The index should be calculated using negative indexing.
 *
 * @param filename The name of the photo file
 * @param album A list containing photo filenames
 * @return The index of the photo in the album
 *
 * Example usage:
 * findPhotograph("photo3.jpg", listOf("photo1.jpg", "photo2.jpg", "photo3.jpg", "photo4.jpg")) // Output: 2
 * findPhotograph("photo2.jpg", listOf("photo1.jpg", "photo2.jpg", "photo3.jpg", "photo4.jpg")) // Output: 1
 */
fun findPhotograph(filename: String, album: List<String>): Int {

    // Iterate over the album in reverse order and check if the current element matches the filename
    for (i in album.size - 1 downTo 0) {
        if (album[i] == filename) {
            return i
        }
    }
    // If no matching photo is found, return -1
    return -1
}
/**
 * This function takes a filename and an album as input and returns the index of the photo with the given filename
 * in the album. The index should be calculated using negative indexing.
 *
 * @param filename The name of the photo file
 * @param album A list containing photo filenames
 * @return The index of the photo in the album
 *
 * Example usage:
 * findPhotograph("photo3.jpg", listOf("photo1.jpg", "photo2.jpg", "photo3.jpg", "photo4.jpg")) // Output: 2
 * findPhotograph("photo2.jpg", listOf("photo1.jpg", "photo2.jpg", "photo3.jpg", "photo4.jpg")) // Output: 1
 */
fun findPhotograph(filename: String, album: List<String>): Int {
/**
 * This function takes a filename and an album as input and returns the index of the photo with the given filename
 * in the album. The index should be calculated using negative indexing.
 *
 * @param filename The name of the photo file
 * @param album A list containing photo filenames
 * @return The index of the photo in the album
 *
 * Example usage:
 * findPhotograph("photo3.jpg", listOf("photo1.jpg", "photo2.jpg", "photo3.jpg", "photo4.jpg")) // Output: 2
 * findPhotograph("photo2.jpg", listOf("photo1.jpg", "photo2.jpg", "photo3.jpg", "photo4.jpg")) // Output: 1
 */
fun findPhotograph(filename: String, album: List<String>): Int {

    // Iterate over the album in reverse order and check if the current element matches the filename
    for (i in album.size - 1 downTo 0) {
        if (album[i] == filename) {
            return i
        }
    }
    // If no matching photo is found, return -1
    return -1
}