/**
 * Given a list of historical events represented by pairs (year, description),
 * write a function to find the most recent event.
 *
 * @param events List<Pair<Int, String>> A list of historical events represented by pairs (year, description).
 * @return Pair<Int, String>? The most recent historical event represented by a pair (year, description). If the
 *         events list is empty, returns null.
 */
fun findMostRecentEvent(events: List<Pair<Int, String>>): Pair<Int, String>? {

    var mostRecentEvent: Pair<Int, String>? = null

    for (event in events) {
        val (year, description) = event

        if (mostRecentEvent == null || year > mostRecentEvent!!.first) {
            mostRecentEvent = Pair(year, description)
        }
    }

    return mostRecentEvent
}
/**
 * Given a list of historical events represented by pairs (year, description),
 * write a function to find the most recent event.
 *
 * @param events List<Pair<Int, String>> A list of historical events represented by pairs (year, description).
 * @return Pair<Int, String>? The most recent historical event represented by a pair (year, description). If the
 *         events list is empty, returns null.
 */
fun findMostRecentEvent(events: List<Pair<Int, String>>): Pair<Int, String>? {
/**
 * Given a list of historical events represented by pairs (year, description),
 * write a function to find the most recent event.
 *
 * @param events List<Pair<Int, String>> A list of historical events represented by pairs (year, description).
 * @return Pair<Int, String>? The most recent historical event represented by a pair (year, description). If the
 *         events list is empty, returns null.
 */
fun findMostRecentEvent(events: List<Pair<Int, String>>): Pair<Int, String>? {

    var mostRecentEvent: Pair<Int, String>? = null

    for (event in events) {
        val (year, description) = event

        if (mostRecentEvent == null || year > mostRecentEvent!!.first) {
            mostRecentEvent = Pair(year, description)
        }
    }

    return mostRecentEvent
}