/**
 * This function takes in a nested list representing a timeline of events and
 * the name of an event, and returns the year in which the event occurred.
 *
 * @param eventTimeline A nested list representing a timeline of events.
 * Each inner list contains two elements: the name of the event and the year
 * in which it occurred.
 * @param eventName The name of the event to find the year for.
 * @return The year in which the specified event occurred.
 *
 * Nested List Format:
 * eventTimeline = [
 *     ["Event 1", 2005],
 *     ["Event 2", 1998],
 *     ["Event 3", 2003],
 *     ...
 * ]
 */
fun findYear(eventTimeline: List<List<Any>>, eventName: String): Int {

    val year = eventTimeline.first { it[0] == eventName }[1] as Int
    return year
}

val eventList = listOf(
    listOf("World War I", 1914),
    listOf("World War II", 1939),
    listOf("Apollo 11 Moon Landing", 1969),
    listOf("Fall of the Berlin Wall", 1989)
)
/**
 * This function takes in a nested list representing a timeline of events and
 * the name of an event, and returns the year in which the event occurred.
 *
 * @param eventTimeline A nested list representing a timeline of events.
 * Each inner list contains two elements: the name of the event and the year
 * in which it occurred.
 * @param eventName The name of the event to find the year for.
 * @return The year in which the specified event occurred.
 *
 * Nested List Format:
 * eventTimeline = [
 *     ["Event 1", 2005],
 *     ["Event 2", 1998],
 *     ["Event 3", 2003],
 *     ...
 * ]
 */
fun findYear(eventTimeline: List<List<Any>>, eventName: String): Int {
/**
 * This function takes in a nested list representing a timeline of events and
 * the name of an event, and returns the year in which the event occurred.
 *
 * @param eventTimeline A nested list representing a timeline of events.
 * Each inner list contains two elements: the name of the event and the year
 * in which it occurred.
 * @param eventName The name of the event to find the year for.
 * @return The year in which the specified event occurred.
 *
 * Nested List Format:
 * eventTimeline = [
 *     ["Event 1", 2005],
 *     ["Event 2", 1998],
 *     ["Event 3", 2003],
 *     ...
 * ]
 */
fun findYear(eventTimeline: List<List<Any>>, eventName: String): Int {

    val year = eventTimeline.first { it[0] == eventName }[1] as Int
    return year
}

val eventList = listOf(
    listOf("World War I", 1914),
    listOf("World War II", 1939),
    listOf("Apollo 11 Moon Landing", 1969),
    listOf("Fall of the Berlin Wall", 1989)
)