/**
 * Given a nested dictionary, return all the values in a list.
 *
 * @param dictionary A nested dictionary.
 * @return A list containing all the values present in the nested dictionary.
 *
 * Example:
 * val dictionary = mapOf("a" to mapOf("b" to 1, "c" to 2), "d" to mapOf("e" to mapOf("f" to 3)))
 * getNestedValues(dictionary)
 * Output: [1, 2, 3]
 */
fun getNestedValues(dictionary: Map<String, Any>): List<Any> {

    val values = mutableListOf<Any>()
    for ((key, value) in dictionary) {
        if (value is Map<*, *>) {
            values.addAll(getNestedValues(value as Map<String, Any>))
        } else {
            values.add(value)
        }
    }
    return values
}
/**
 * Given a nested dictionary, return all the values in a list.
 *
 * @param dictionary A nested dictionary.
 * @return A list containing all the values present in the nested dictionary.
 *
 * Example:
 * val dictionary = mapOf("a" to mapOf("b" to 1, "c" to 2), "d" to mapOf("e" to mapOf("f" to 3)))
 * getNestedValues(dictionary)
 * Output: [1, 2, 3]
 */
fun getNestedValues(dictionary: Map<String, Any>): List<Any> {
/**
 * Given a nested dictionary, return all the values in a list.
 *
 * @param dictionary A nested dictionary.
 * @return A list containing all the values present in the nested dictionary.
 *
 * Example:
 * val dictionary = mapOf("a" to mapOf("b" to 1, "c" to 2), "d" to mapOf("e" to mapOf("f" to 3)))
 * getNestedValues(dictionary)
 * Output: [1, 2, 3]
 */
fun getNestedValues(dictionary: Map<String, Any>): List<Any> {

    val values = mutableListOf<Any>()
    for ((key, value) in dictionary) {
        if (value is Map<*, *>) {
            values.addAll(getNestedValues(value as Map<String, Any>))
        } else {
            values.add(value)
        }
    }
    return values
}