/**
 * Given a list of historical events and a specific identity, find the intersection of events that match the
 * provided identity using identity comparison.
 *
 * @param history A list of historical events
 * @param identity The specific identity to match
 * @return A list of events that match the provided identity
 */
fun intersectionMatch(history: List<String>, identity: String): List<Int> {

    val matchedEvents = mutableListOf<Int>()
    for ((index, eventIdentity) in history.withIndex()) {
        if (eventIdentity == identity) {
            matchedEvents.add(index)
        }
    }
    return matchedEvents
}

// Example usage
/**
 * Given a list of historical events and a specific identity, find the intersection of events that match the
 * provided identity using identity comparison.
 *
 * @param history A list of historical events
 * @param identity The specific identity to match
 * @return A list of events that match the provided identity
 */
fun intersectionMatch(history: List<String>, identity: String): List<Int> {
/**
 * Given a list of historical events and a specific identity, find the intersection of events that match the
 * provided identity using identity comparison.
 *
 * @param history A list of historical events
 * @param identity The specific identity to match
 * @return A list of events that match the provided identity
 */
fun intersectionMatch(history: List<String>, identity: String): List<Int> {

    val matchedEvents = mutableListOf<Int>()
    for ((index, eventIdentity) in history.withIndex()) {
        if (eventIdentity == identity) {
            matchedEvents.add(index)
        }
    }
    return matchedEvents
}

// Example usage