/**
 * Given a tuple of geological data, this function finds the intersection of two conditions:
 * 1. Looping through the elements of the tuple.
 * 2. Creating an infinite loop until a specific condition is met.
 *
 * Complete the code by implementing the missing part in the loop to find the intersection.
 *
 * @param geologicalData A tuple containing geological data to be processed.
 * @return The intersection of looping through the tuple and creating an infinite loop.
 *
 * Note:
 * - The geologicalData contains numeric values only.
 */
fun processData(geologicalData: List<Int>): List<Int> {

    var intersection = emptyList<Int>()
    var index = 0

    while (true) {
        // Loop through the tuple and stop when reaching the end or when an intersection is found
        if (index >= geologicalData.size) {
            break
        }

        // YOUR CODE HERE: Implement the missing part to check for an intersection condition
        if (geologicalData.subList(0, index + 1).sum() > 1000) {
            intersection = geologicalData.subList(0, index + 1)
            break
        }

        index++
    }

    return intersection
}
/**
 * Given a tuple of geological data, this function finds the intersection of two conditions:
 * 1. Looping through the elements of the tuple.
 * 2. Creating an infinite loop until a specific condition is met.
 *
 * Complete the code by implementing the missing part in the loop to find the intersection.
 *
 * @param geologicalData A tuple containing geological data to be processed.
 * @return The intersection of looping through the tuple and creating an infinite loop.
 *
 * Note:
 * - The geologicalData contains numeric values only.
 */
fun processData(geologicalData: List<Int>): List<Int> {
/**
 * Given a tuple of geological data, this function finds the intersection of two conditions:
 * 1. Looping through the elements of the tuple.
 * 2. Creating an infinite loop until a specific condition is met.
 *
 * Complete the code by implementing the missing part in the loop to find the intersection.
 *
 * @param geologicalData A tuple containing geological data to be processed.
 * @return The intersection of looping through the tuple and creating an infinite loop.
 *
 * Note:
 * - The geologicalData contains numeric values only.
 */
fun processData(geologicalData: List<Int>): List<Int> {

    var intersection = emptyList<Int>()
    var index = 0

    while (true) {
        // Loop through the tuple and stop when reaching the end or when an intersection is found
        if (index >= geologicalData.size) {
            break
        }

        // YOUR CODE HERE: Implement the missing part to check for an intersection condition
        if (geologicalData.subList(0, index + 1).sum() > 1000) {
            intersection = geologicalData.subList(0, index + 1)
            break
        }

        index++
    }

    return intersection
}