/**
 * This function takes a list of tuples and a value as input, and returns a list of indices indicating 
 * the positions where the value exists in the tuples.
 *
 * @param tuples A list of tuples.
 * @param value The value to be searched in the tuples.
 * @return A list of indices where the value exists in the tuples.
 *
 * Example:
 * findTupleIndex(listOf(1 to 2 to 3, 4 to 5 to 6, 7 to 8 to 9), 6) // Output: [(1, 2)]
 */
fun findTupleIndex(tuples: List<Triple<Int, Int, Int>>, value: Int): List<Pair<Int, Int>> {

    val indices = mutableListOf<Pair<Int, Int>>()

    for (i in tuples.indices) {
        for (j in 0 until 3) {
            if (tuples[i].toList()[j] == value) {
                indices.add(Pair(i, j))
            }
        }
    }

    return indices
}
/**
 * This function takes a list of tuples and a value as input, and returns a list of indices indicating 
 * the positions where the value exists in the tuples.
 *
 * @param tuples A list of tuples.
 * @param value The value to be searched in the tuples.
 * @return A list of indices where the value exists in the tuples.
 *
 * Example:
 * findTupleIndex(listOf(1 to 2 to 3, 4 to 5 to 6, 7 to 8 to 9), 6) // Output: [(1, 2)]
 */
fun findTupleIndex(tuples: List<Triple<Int, Int, Int>>, value: Int): List<Pair<Int, Int>> {
/**
 * This function takes a list of tuples and a value as input, and returns a list of indices indicating 
 * the positions where the value exists in the tuples.
 *
 * @param tuples A list of tuples.
 * @param value The value to be searched in the tuples.
 * @return A list of indices where the value exists in the tuples.
 *
 * Example:
 * findTupleIndex(listOf(1 to 2 to 3, 4 to 5 to 6, 7 to 8 to 9), 6) // Output: [(1, 2)]
 */
fun findTupleIndex(tuples: List<Triple<Int, Int, Int>>, value: Int): List<Pair<Int, Int>> {

    val indices = mutableListOf<Pair<Int, Int>>()

    for (i in tuples.indices) {
        for (j in 0 until 3) {
            if (tuples[i].toList()[j] == value) {
                indices.add(Pair(i, j))
            }
        }
    }

    return indices
}