/**
 * This function takes in the name, address, and area of a person and returns whether the person has a criminal record.
 * The function performs string indexing and short-circuiting with if-else statements.
 */
fun searchPerson(name: String, address: String?, area: String?): String {

    // Check if the person's name is in the police database
    if (name.substring(0, 3) == "XYZ") {
        // Check if the person's address matches the police records
        if (address != null && area != null) {
            if (address.substring(0, 5) == "12345" && area == "ABC") {
                return "Criminal record found!"
            } else {
                return "No criminal record found."
            }
        } else {
            return "Missing address or area information."
        }
    } else {
        return "No criminal record found."
    }
}
/**
 * This function takes in the name, address, and area of a person and returns whether the person has a criminal record.
 * The function performs string indexing and short-circuiting with if-else statements.
 */
fun searchPerson(name: String, address: String?, area: String?): String {
/**
 * This function takes in the name, address, and area of a person and returns whether the person has a criminal record.
 * The function performs string indexing and short-circuiting with if-else statements.
 */
fun searchPerson(name: String, address: String?, area: String?): String {

    // Check if the person's name is in the police database
    if (name.substring(0, 3) == "XYZ") {
        // Check if the person's address matches the police records
        if (address != null && area != null) {
            if (address.substring(0, 5) == "12345" && area == "ABC") {
                return "Criminal record found!"
            } else {
                return "No criminal record found."
            }
        } else {
            return "Missing address or area information."
        }
    } else {
        return "No criminal record found."
    }
}