/**
 * This function takes a tuple and two indices representing a range.
 * It counts the number of elements within that range in the tuple and returns the count.
 */
fun countElementsInTuple(tup: List<Any>, start: Int, end: Int): Int {

    var count = 0
    for (i in start..end) {
        val element = tup[i]
        if (element is List<*>) {
            count += countElementsInTuple(element as List<Any>, 0, element.size - 1)
        } else {
            count++
        }
    }
    return count
}
/**
 * This function takes a tuple and two indices representing a range.
 * It counts the number of elements within that range in the tuple and returns the count.
 */
fun countElementsInTuple(tup: List<Any>, start: Int, end: Int): Int {
/**
 * This function takes a tuple and two indices representing a range.
 * It counts the number of elements within that range in the tuple and returns the count.
 */
fun countElementsInTuple(tup: List<Any>, start: Int, end: Int): Int {

    var count = 0
    for (i in start..end) {
        val element = tup[i]
        if (element is List<*>) {
            count += countElementsInTuple(element as List<Any>, 0, element.size - 1)
        } else {
            count++
        }
    }
    return count
}