/**
 * Given a dictionary, compares each value in the dictionary with all other values.
 *
 * @param dictionary A dictionary with string keys and integer values.
 * @return A list containing tuples of keys that have the same value.
 *
 * Example:
 * val dictionary = mapOf("a" to 1, "b" to 2, "c" to 1, "d" to 3, "e" to 2)
 * compareDictValues(dictionary)
 * Output: [('a', 'c'), ('b', 'e')]
 */
fun compareDictValues(dictionary: Map<String, Int>): List<Pair<String, String>> {

    val equalValues = mutableListOf<Pair<String, String>>()
    val dictKeys = dictionary.keys.toList()

    for (i in dictKeys.indices) {
        for (j in i + 1 until dictKeys.size) {
            if (dictionary[dictKeys[i]] == dictionary[dictKeys[j]]) {
                equalValues.add(Pair(dictKeys[i], dictKeys[j]))
            }
        }
    }

    return equalValues
}
/**
 * Given a dictionary, compares each value in the dictionary with all other values.
 *
 * @param dictionary A dictionary with string keys and integer values.
 * @return A list containing tuples of keys that have the same value.
 *
 * Example:
 * val dictionary = mapOf("a" to 1, "b" to 2, "c" to 1, "d" to 3, "e" to 2)
 * compareDictValues(dictionary)
 * Output: [('a', 'c'), ('b', 'e')]
 */
fun compareDictValues(dictionary: Map<String, Int>): List<Pair<String, String>> {
/**
 * Given a dictionary, compares each value in the dictionary with all other values.
 *
 * @param dictionary A dictionary with string keys and integer values.
 * @return A list containing tuples of keys that have the same value.
 *
 * Example:
 * val dictionary = mapOf("a" to 1, "b" to 2, "c" to 1, "d" to 3, "e" to 2)
 * compareDictValues(dictionary)
 * Output: [('a', 'c'), ('b', 'e')]
 */
fun compareDictValues(dictionary: Map<String, Int>): List<Pair<String, String>> {

    val equalValues = mutableListOf<Pair<String, String>>()
    val dictKeys = dictionary.keys.toList()

    for (i in dictKeys.indices) {
        for (j in i + 1 until dictKeys.size) {
            if (dictionary[dictKeys[i]] == dictionary[dictKeys[j]]) {
                equalValues.add(Pair(dictKeys[i], dictKeys[j]))
            }
        }
    }

    return equalValues
}