/**
 * Given a list of tuples and a dictionary, modify the values in the dictionary using the items from the tuples.
 *
 * Each tuple has three elements: the first element represents the key in the dictionary, the second element represents the index of the value (which is a list) to be modified, and the third element represents the new value.
 *
 * @param tuples List of tuples containing key, index, and new value
 * @param dictionary The dictionary to be modified
 * @return The modified dictionary
 */
fun modifyTupleDict(tuples: List<Triple<String, Int, Any>>, dictionary: MutableMap<String, MutableList<Any>>): MutableMap<String, MutableList<Any>> {

    for ((key, index, value) in tuples) {
        if (dictionary.containsKey(key)) {
            val list = dictionary[key]
            if (list != null && index < list.size) {
                list[index] = value
            }
        }
    }
    return dictionary
}
/**
 * Given a list of tuples and a dictionary, modify the values in the dictionary using the items from the tuples.
 *
 * Each tuple has three elements: the first element represents the key in the dictionary, the second element represents the index of the value (which is a list) to be modified, and the third element represents the new value.
 *
 * @param tuples List of tuples containing key, index, and new value
 * @param dictionary The dictionary to be modified
 * @return The modified dictionary
 */
fun modifyTupleDict(tuples: List<Triple<String, Int, Any>>, dictionary: MutableMap<String, MutableList<Any>>): MutableMap<String, MutableList<Any>> {
/**
 * Given a list of tuples and a dictionary, modify the values in the dictionary using the items from the tuples.
 *
 * Each tuple has three elements: the first element represents the key in the dictionary, the second element represents the index of the value (which is a list) to be modified, and the third element represents the new value.
 *
 * @param tuples List of tuples containing key, index, and new value
 * @param dictionary The dictionary to be modified
 * @return The modified dictionary
 */
fun modifyTupleDict(tuples: List<Triple<String, Int, Any>>, dictionary: MutableMap<String, MutableList<Any>>): MutableMap<String, MutableList<Any>> {

    for ((key, index, value) in tuples) {
        if (dictionary.containsKey(key)) {
            val list = dictionary[key]
            if (list != null && index < list.size) {
                list[index] = value
            }
        }
    }
    return dictionary
}