/**
 * This function takes in two tuples, tup1 and tup2,
 * and an index number, idx. It compares the elements
 * at the specified index in each tuple and returns
 * a boolean value indicating whether the elements
 * are equal.
 *
 * @param tup1 The first tuple.
 * @param tup2 The second tuple.
 * @param idx The index number to compare.
 * @return True if the elements are equal, False otherwise.
 */
fun compareTupleElements(tup1: List<Int>, tup2: List<Int>, idx: Int): Boolean {

    // Check if the index is within the range of the tuples
    if (idx in 0 until tup1.size && idx in 0 until tup2.size) {
        // Compare the elements at the specified index
        return tup1[idx] == tup2[idx]
    } else {
        return false
    }
}

// Example usage
val tup1 = listOf(1, 2, 3, 4, 5)
val tup2 = listOf(6, 7, 8, 9, 10)
val index = 2

// Check if the elements at index 2 are equal in tup1 and tup2
val result = compareTupleElements(tup1, tup2, index)
/**
 * This function takes in two tuples, tup1 and tup2,
 * and an index number, idx. It compares the elements
 * at the specified index in each tuple and returns
 * a boolean value indicating whether the elements
 * are equal.
 *
 * @param tup1 The first tuple.
 * @param tup2 The second tuple.
 * @param idx The index number to compare.
 * @return True if the elements are equal, False otherwise.
 */
fun compareTupleElements(tup1: List<Int>, tup2: List<Int>, idx: Int): Boolean {
/**
 * This function takes in two tuples, tup1 and tup2,
 * and an index number, idx. It compares the elements
 * at the specified index in each tuple and returns
 * a boolean value indicating whether the elements
 * are equal.
 *
 * @param tup1 The first tuple.
 * @param tup2 The second tuple.
 * @param idx The index number to compare.
 * @return True if the elements are equal, False otherwise.
 */
fun compareTupleElements(tup1: List<Int>, tup2: List<Int>, idx: Int): Boolean {

    // Check if the index is within the range of the tuples
    if (idx in 0 until tup1.size && idx in 0 until tup2.size) {
        // Compare the elements at the specified index
        return tup1[idx] == tup2[idx]
    } else {
        return false
    }
}

// Example usage
val tup1 = listOf(1, 2, 3, 4, 5)
val tup2 = listOf(6, 7, 8, 9, 10)
val index = 2

// Check if the elements at index 2 are equal in tup1 and tup2
val result = compareTupleElements(tup1, tup2, index)