/**
 * This exercise requires you to remove a specific element from a list of values
 * stored in a dictionary, while looping through the dictionary.
 *
 * Your task is to complete the code below by removing the given 'element' from the
 * list of values associated with each key in the 'dictionary'.
 *
 * @param dictionary A dictionary with keys and values
 * @param element The element to be removed from the value lists
 * @return The modified dictionary with the 'element' removed from the value lists
 *
 * Note:
 * - You should consider a scenario where the 'element' may appear more than once
 *   in a value list, and all occurrences of 'element' should be removed.
 * - Make sure to modify the 'dictionary' in-place and not create a new dictionary.
 */
fun removeElements(dictionary: MutableMap<String, Any>, element: Any): MutableMap<String, Any> {

    for ((key, value) in dictionary) {
        if (value is MutableList<*>) {
            dictionary[key] = value.filterNot { it == element }.toMutableList()
        }
    }
    return dictionary
}
/**
 * This exercise requires you to remove a specific element from a list of values
 * stored in a dictionary, while looping through the dictionary.
 *
 * Your task is to complete the code below by removing the given 'element' from the
 * list of values associated with each key in the 'dictionary'.
 *
 * @param dictionary A dictionary with keys and values
 * @param element The element to be removed from the value lists
 * @return The modified dictionary with the 'element' removed from the value lists
 *
 * Note:
 * - You should consider a scenario where the 'element' may appear more than once
 *   in a value list, and all occurrences of 'element' should be removed.
 * - Make sure to modify the 'dictionary' in-place and not create a new dictionary.
 */
fun removeElements(dictionary: MutableMap<String, Any>, element: Any): MutableMap<String, Any> {
/**
 * This exercise requires you to remove a specific element from a list of values
 * stored in a dictionary, while looping through the dictionary.
 *
 * Your task is to complete the code below by removing the given 'element' from the
 * list of values associated with each key in the 'dictionary'.
 *
 * @param dictionary A dictionary with keys and values
 * @param element The element to be removed from the value lists
 * @return The modified dictionary with the 'element' removed from the value lists
 *
 * Note:
 * - You should consider a scenario where the 'element' may appear more than once
 *   in a value list, and all occurrences of 'element' should be removed.
 * - Make sure to modify the 'dictionary' in-place and not create a new dictionary.
 */
fun removeElements(dictionary: MutableMap<String, Any>, element: Any): MutableMap<String, Any> {

    for ((key, value) in dictionary) {
        if (value is MutableList<*>) {
            dictionary[key] = value.filterNot { it == element }.toMutableList()
        }
    }
    return dictionary
}