/**
 * Given a nested list, this function returns a new list with elements that are the intersection
 * of all the sublists in the input list using list slicing and nested for loops.
 *
 * @param lst A nested list containing sublists
 * @return A new list with elements that are present in all sublists
 *
 * Example:
 * nestedListSlicing(listOf(listOf(1, 2, 3, 4), listOf(2, 3, 4, 5), listOf(3, 4, 5, 6))) returns [3, 4]
 */
fun nestedListSlicing(lst: List<List<Int>>): List<Int> {

    if (lst.isEmpty()) {
        return emptyList()
    }

    // Initialize the intersection list with the elements of the first sublist
    var intersection = lst[0]

    // Iterate over each sublist starting from the second sublist
    for (sublist in lst.subList(1, lst.size)) {
        // Initialize an empty list to store common elements between intersection and the current sublist
        val commonElements = mutableListOf<Int>()

        // Iterate over each element in the intersection list
        for (elem in intersection) {
            // If the element is present in the current sublist,
        }
    }

    return intersection
}
/**
 * Given a nested list, this function returns a new list with elements that are the intersection
 * of all the sublists in the input list using list slicing and nested for loops.
 *
 * @param lst A nested list containing sublists
 * @return A new list with elements that are present in all sublists
 *
 * Example:
 * nestedListSlicing(listOf(listOf(1, 2, 3, 4), listOf(2, 3, 4, 5), listOf(3, 4, 5, 6))) returns [3, 4]
 */
fun nestedListSlicing(lst: List<List<Int>>): List<Int> {
/**
 * Given a nested list, this function returns a new list with elements that are the intersection
 * of all the sublists in the input list using list slicing and nested for loops.
 *
 * @param lst A nested list containing sublists
 * @return A new list with elements that are present in all sublists
 *
 * Example:
 * nestedListSlicing(listOf(listOf(1, 2, 3, 4), listOf(2, 3, 4, 5), listOf(3, 4, 5, 6))) returns [3, 4]
 */
fun nestedListSlicing(lst: List<List<Int>>): List<Int> {

    if (lst.isEmpty()) {
        return emptyList()
    }

    // Initialize the intersection list with the elements of the first sublist
    var intersection = lst[0]

    // Iterate over each sublist starting from the second sublist
    for (sublist in lst.subList(1, lst.size)) {
        // Initialize an empty list to store common elements between intersection and the current sublist
        val commonElements = mutableListOf<Int>()

        // Iterate over each element in the intersection list
        for (elem in intersection) {
            // If the element is present in the current sublist,
        }
    }

    return intersection
}