/**
 * This function takes a nested list (data) and a list of indices (indices). It returns the value located at the specified indices by accessing elements with nested index.
 *
 * @param data A nested list.
 * @param indices A list of indices specifying the path to the desired value.
 * @return The value located at the specified indices.
 */
fun getNestedValue(data: List<*>, indices: List<Int>): Any? {

    try {
        var value: Any? = data[indices[0]]
        for (index in indices.subList(1, indices.size)) {
            value = (value as List<*>)[index]
        }
        return value
    } catch (e: IndexOutOfBoundsException) {
        return null
    } catch (e: ClassCastException) {
        return null
    }
}
/**
 * This function takes a nested list (data) and a list of indices (indices). It returns the value located at the specified indices by accessing elements with nested index.
 *
 * @param data A nested list.
 * @param indices A list of indices specifying the path to the desired value.
 * @return The value located at the specified indices.
 */
fun getNestedValue(data: List<*>, indices: List<Int>): Any? {
/**
 * This function takes a nested list (data) and a list of indices (indices). It returns the value located at the specified indices by accessing elements with nested index.
 *
 * @param data A nested list.
 * @param indices A list of indices specifying the path to the desired value.
 * @return The value located at the specified indices.
 */
fun getNestedValue(data: List<*>, indices: List<Int>): Any? {

    try {
        var value: Any? = data[indices[0]]
        for (index in indices.subList(1, indices.size)) {
            value = (value as List<*>)[index]
        }
        return value
    } catch (e: IndexOutOfBoundsException) {
        return null
    } catch (e: ClassCastException) {
        return null
    }
}