/**
 * Given a list of tuples and an index, filter out the tuples where the value at the
 * given index is false.
 *
 * @param tuples A list of tuples containing boolean values.
 * @param idx The index position to check in each tuple.
 * @return A list of tuples where the value at the given index is true.
 */
fun filterTuples(tuples: List<List<Boolean>>, idx: Int): List<List<Boolean>> {

    val filteredTuples = mutableListOf<List<Boolean>>()
    for (tup in tuples) {
        if (tup[idx]) {
            filteredTuples.add(tup)
        }
    }
    return filteredTuples
}
/**
 * Given a list of tuples and an index, filter out the tuples where the value at the
 * given index is false.
 *
 * @param tuples A list of tuples containing boolean values.
 * @param idx The index position to check in each tuple.
 * @return A list of tuples where the value at the given index is true.
 */
fun filterTuples(tuples: List<List<Boolean>>, idx: Int): List<List<Boolean>> {
/**
 * Given a list of tuples and an index, filter out the tuples where the value at the
 * given index is false.
 *
 * @param tuples A list of tuples containing boolean values.
 * @param idx The index position to check in each tuple.
 * @return A list of tuples where the value at the given index is true.
 */
fun filterTuples(tuples: List<List<Boolean>>, idx: Int): List<List<Boolean>> {

    val filteredTuples = mutableListOf<List<Boolean>>()
    for (tup in tuples) {
        if (tup[idx]) {
            filteredTuples.add(tup)
        }
    }
    return filteredTuples
}