/**
 * The function takes a list of data and a break keyword as inputs.
 * It iterates over the data and finds the regions where the break keyword exists.
 * Returns a list of the regions where the break keyword occurs.
 *
 * Example:
 * data = listOf(1, 2, "break", 3, 4, 5, "break", 6, 7)
 * breakKeyword = "break"
 * findBreakableRegions(data, breakKeyword) -> listOf(Pair(2, 6), Pair(6, 9))
 */
fun findBreakableRegions(data: List<Any>, breakKeyword: Any): List<Pair<Int, Int>> {

    val regions = mutableListOf<Pair<Int, Int>>()
    var startIndex: Int? = null

    data.forEachIndexed { index, item ->
        if (item == breakKeyword) {
            if (startIndex != null) {
                regions.add(Pair(startIndex!!, index))
            }
            startIndex = index + 1
        }
    }

    if (startIndex != null) {
        regions.add(Pair(startIndex!!, data.size))
    }

    return regions
}
/**
 * The function takes a list of data and a break keyword as inputs.
 * It iterates over the data and finds the regions where the break keyword exists.
 * Returns a list of the regions where the break keyword occurs.
 *
 * Example:
 * data = listOf(1, 2, "break", 3, 4, 5, "break", 6, 7)
 * breakKeyword = "break"
 * findBreakableRegions(data, breakKeyword) -> listOf(Pair(2, 6), Pair(6, 9))
 */
fun findBreakableRegions(data: List<Any>, breakKeyword: Any): List<Pair<Int, Int>> {
/**
 * The function takes a list of data and a break keyword as inputs.
 * It iterates over the data and finds the regions where the break keyword exists.
 * Returns a list of the regions where the break keyword occurs.
 *
 * Example:
 * data = listOf(1, 2, "break", 3, 4, 5, "break", 6, 7)
 * breakKeyword = "break"
 * findBreakableRegions(data, breakKeyword) -> listOf(Pair(2, 6), Pair(6, 9))
 */
fun findBreakableRegions(data: List<Any>, breakKeyword: Any): List<Pair<Int, Int>> {

    val regions = mutableListOf<Pair<Int, Int>>()
    var startIndex: Int? = null

    data.forEachIndexed { index, item ->
        if (item == breakKeyword) {
            if (startIndex != null) {
                regions.add(Pair(startIndex!!, index))
            }
            startIndex = index + 1
        }
    }

    if (startIndex != null) {
        regions.add(Pair(startIndex!!, data.size))
    }

    return regions
}