/**
 * This function checks if a historical event occurred on a particular date.
 *
 * @param date The date in the format 'YYYY-MM-DD'.
 * @param event The name of the historical event.
 * @return True if the event occurred on the given date, False otherwise.
 */
fun checkHistoricalEvent(date: String, event: String): Boolean {

    val historicalEvents = mapOf(
        "1776-07-04" to "Declaration of Independence",
        "1789-07-14" to "French Revolution",
        "1865-04-15" to "Assassination of Abraham Lincoln",
        "1969-07-20" to "Apollo 11 Moon Landing",
        "1989-11-09" to "Fall of the Berlin Wall"
    )

    var eventDate: String? = null

    // Short-circuiting AND operator ensures that the event date is retrieved only when necessary
    if (historicalEvents.containsKey(date) && historicalEvents[date] == event) {
        eventDate = date
    }

    return eventDate != null
}
/**
 * This function checks if a historical event occurred on a particular date.
 *
 * @param date The date in the format 'YYYY-MM-DD'.
 * @param event The name of the historical event.
 * @return True if the event occurred on the given date, False otherwise.
 */
fun checkHistoricalEvent(date: String, event: String): Boolean {
/**
 * This function checks if a historical event occurred on a particular date.
 *
 * @param date The date in the format 'YYYY-MM-DD'.
 * @param event The name of the historical event.
 * @return True if the event occurred on the given date, False otherwise.
 */
fun checkHistoricalEvent(date: String, event: String): Boolean {

    val historicalEvents = mapOf(
        "1776-07-04" to "Declaration of Independence",
        "1789-07-14" to "French Revolution",
        "1865-04-15" to "Assassination of Abraham Lincoln",
        "1969-07-20" to "Apollo 11 Moon Landing",
        "1989-11-09" to "Fall of the Berlin Wall"
    )

    var eventDate: String? = null

    // Short-circuiting AND operator ensures that the event date is retrieved only when necessary
    if (historicalEvents.containsKey(date) && historicalEvents[date] == event) {
        eventDate = date
    }

    return eventDate != null
}