/**
 * A police officer is trying to find the culprits from a list of criminals.
 * Write a function that takes in a list of Pair<String, Int> representing criminals' names and ages,
 * and returns a list of criminals who are above the age of 5.
 * The function should also print each culprit's name along with their age.
 */
fun findCulprits(criminals: List<Pair<String, Int>>): List<String> {

    val culpritsAbove5 = mutableListOf<String>()  // List to store the criminals above the age of 5

    for (criminal in criminals) {
        if (criminal.second > 5) {  // Checks if the age of the criminal is greater than 5
            culpritsAbove5.add(criminal.first)  // Adds the name of the criminal to the list
        }
    }

    // Prints the name and age of each culprit above the age of 5
    for (culprit in culpritsAbove5) {
        println("Culprit: $culprit")
    }

    return culpritsAbove5
}

// Sample Usage
val criminals = listOf(Pair("John Doe", 4), Pair("Jane Smith", 6), Pair("Mike Johnson", 3), Pair("David Brown", 9))
val culprits = findCulprits(criminals)
/**
 * A police officer is trying to find the culprits from a list of criminals.
 * Write a function that takes in a list of Pair<String, Int> representing criminals' names and ages,
 * and returns a list of criminals who are above the age of 5.
 * The function should also print each culprit's name along with their age.
 */
fun findCulprits(criminals: List<Pair<String, Int>>): List<String> {
/**
 * A police officer is trying to find the culprits from a list of criminals.
 * Write a function that takes in a list of Pair<String, Int> representing criminals' names and ages,
 * and returns a list of criminals who are above the age of 5.
 * The function should also print each culprit's name along with their age.
 */
fun findCulprits(criminals: List<Pair<String, Int>>): List<String> {

    val culpritsAbove5 = mutableListOf<String>()  // List to store the criminals above the age of 5

    for (criminal in criminals) {
        if (criminal.second > 5) {  // Checks if the age of the criminal is greater than 5
            culpritsAbove5.add(criminal.first)  // Adds the name of the criminal to the list
        }
    }

    // Prints the name and age of each culprit above the age of 5
    for (culprit in culpritsAbove5) {
        println("Culprit: $culprit")
    }

    return culpritsAbove5
}

// Sample Usage
val criminals = listOf(Pair("John Doe", 4), Pair("Jane Smith", 6), Pair("Mike Johnson", 3), Pair("David Brown", 9))
val culprits = findCulprits(criminals)