/**
 * This function takes a list of photos and returns a new list containing only the valid photos.
 * A valid photo is one that meets the following criteria:
 * 1. The resolution must be greater than 10 pixels.
 * 2. The file size must be less than 100 KB.
 * 3. The aspect ratio must be between 1.5 and 2.5.
 */
fun getValidPhotos(photos: List<Map<String, Any>>): List<Map<String, Any>> {

    val validPhotos = mutableListOf<Map<String, Any>>()
    val epsilon = 0.00001

    for (photo in photos) {
        val resolution = photo["resolution"] as Int
        val fileSize = photo["file_size"] as Int
        val aspectRatio = photo["aspect_ratio"] as Double

        // Check resolution
        if (resolution > 10) {
            // Check file size
            if (fileSize < 100) {
                // Check aspect ratio
                if (1.5 - epsilon < aspectRatio && aspectRatio < 2.5 + epsilon) {
                    validPhotos.add(photo)
                }
            }
        }
    }

    return validPhotos
}
/**
 * This function takes a list of photos and returns a new list containing only the valid photos.
 * A valid photo is one that meets the following criteria:
 * 1. The resolution must be greater than 10 pixels.
 * 2. The file size must be less than 100 KB.
 * 3. The aspect ratio must be between 1.5 and 2.5.
 */
fun getValidPhotos(photos: List<Map<String, Any>>): List<Map<String, Any>> {
/**
 * This function takes a list of photos and returns a new list containing only the valid photos.
 * A valid photo is one that meets the following criteria:
 * 1. The resolution must be greater than 10 pixels.
 * 2. The file size must be less than 100 KB.
 * 3. The aspect ratio must be between 1.5 and 2.5.
 */
fun getValidPhotos(photos: List<Map<String, Any>>): List<Map<String, Any>> {

    val validPhotos = mutableListOf<Map<String, Any>>()
    val epsilon = 0.00001

    for (photo in photos) {
        val resolution = photo["resolution"] as Int
        val fileSize = photo["file_size"] as Int
        val aspectRatio = photo["aspect_ratio"] as Double

        // Check resolution
        if (resolution > 10) {
            // Check file size
            if (fileSize < 100) {
                // Check aspect ratio
                if (1.5 - epsilon < aspectRatio && aspectRatio < 2.5 + epsilon) {
                    validPhotos.add(photo)
                }
            }
        }
    }

    return validPhotos
}