/**
 * This function takes a dictionary of crimes with their corresponding suspects and returns a list of solved crimes.
 */
fun solveCrimes(crimes: Map<String, String>, suspects: List<String>): List<String> {

    val solvedCrimes = mutableListOf<String>()

    for ((crime, suspect) in crimes) {
        if (suspect !in suspects) {
            continue
        }

        for (s in suspects) {
            if (s == suspect && s !in solvedCrimes) {
                solvedCrimes.add(crime)
                break
            }
        }
    }

    return solvedCrimes
}

// TEST CASES
/**
 * This function takes a dictionary of crimes with their corresponding suspects and returns a list of solved crimes.
 */
fun solveCrimes(crimes: Map<String, String>, suspects: List<String>): List<String> {
/**
 * This function takes a dictionary of crimes with their corresponding suspects and returns a list of solved crimes.
 */
fun solveCrimes(crimes: Map<String, String>, suspects: List<String>): List<String> {

    val solvedCrimes = mutableListOf<String>()

    for ((crime, suspect) in crimes) {
        if (suspect !in suspects) {
            continue
        }

        for (s in suspects) {
            if (s == suspect && s !in solvedCrimes) {
                solvedCrimes.add(crime)
                break
            }
        }
    }

    return solvedCrimes
}

// TEST CASES