/**
 * Given a list of historical events and a list of new events, modify the original list by deleting duplicate events
 * and adding new events. Return the modified list.
 *
 * @param events A list of historical events.
 * @param newEvents A list of new events.
 * @return The modified list of historical events.
 *
 * Example:
 * events = ['World War II', 'American Civil War', 'French Revolution']
 * newEvents = ['World War II', 'Renaissance', 'Roman Empire']
 * modifyHistoricalEvents(events, newEvents) -> ['American Civil War', 'French Revolution', 'Renaissance', 'Roman Empire']
 */
fun modifyHistoricalEvents(events: MutableList<String>, newEvents: List<String>): List<String> {

    // Remove duplicate events from the original list
    events.removeAll { newEvents.contains(it) }

    // Add new events to the original list
    events.addAll(newEvents)

    return events
}
/**
 * Given a list of historical events and a list of new events, modify the original list by deleting duplicate events
 * and adding new events. Return the modified list.
 *
 * @param events A list of historical events.
 * @param newEvents A list of new events.
 * @return The modified list of historical events.
 *
 * Example:
 * events = ['World War II', 'American Civil War', 'French Revolution']
 * newEvents = ['World War II', 'Renaissance', 'Roman Empire']
 * modifyHistoricalEvents(events, newEvents) -> ['American Civil War', 'French Revolution', 'Renaissance', 'Roman Empire']
 */
fun modifyHistoricalEvents(events: MutableList<String>, newEvents: List<String>): List<String> {
/**
 * Given a list of historical events and a list of new events, modify the original list by deleting duplicate events
 * and adding new events. Return the modified list.
 *
 * @param events A list of historical events.
 * @param newEvents A list of new events.
 * @return The modified list of historical events.
 *
 * Example:
 * events = ['World War II', 'American Civil War', 'French Revolution']
 * newEvents = ['World War II', 'Renaissance', 'Roman Empire']
 * modifyHistoricalEvents(events, newEvents) -> ['American Civil War', 'French Revolution', 'Renaissance', 'Roman Empire']
 */
fun modifyHistoricalEvents(events: MutableList<String>, newEvents: List<String>): List<String> {

    // Remove duplicate events from the original list
    events.removeAll { newEvents.contains(it) }

    // Add new events to the original list
    events.addAll(newEvents)

    return events
}