/**
 * Given a dictionary of photo metadata and a tag, find all photos that have the specified tag.
 *
 * @param metadata A dictionary mapping photo names to metadata
 * @param tag A string representing the tag
 * @return A list of photo names that have the specified tag
 */
fun findSimilarPhotos(metadata: Map<String, Map<String, List<String>>>, tag: String): List<String> {

    val similarPhotos = mutableListOf<String>()
    for ((photo, data) in metadata) {
        if (tag in data["tags"] ?: emptyList()) {
            similarPhotos.add(photo)
        }
    }
    return similarPhotos
}
/**
 * Given a dictionary of photo metadata and a tag, find all photos that have the specified tag.
 *
 * @param metadata A dictionary mapping photo names to metadata
 * @param tag A string representing the tag
 * @return A list of photo names that have the specified tag
 */
fun findSimilarPhotos(metadata: Map<String, Map<String, List<String>>>, tag: String): List<String> {
/**
 * Given a dictionary of photo metadata and a tag, find all photos that have the specified tag.
 *
 * @param metadata A dictionary mapping photo names to metadata
 * @param tag A string representing the tag
 * @return A list of photo names that have the specified tag
 */
fun findSimilarPhotos(metadata: Map<String, Map<String, List<String>>>, tag: String): List<String> {

    val similarPhotos = mutableListOf<String>()
    for ((photo, data) in metadata) {
        if (tag in data["tags"] ?: emptyList()) {
            similarPhotos.add(photo)
        }
    }
    return similarPhotos
}