/**
 * This function determines if a name belongs to a potential firefighter based on certain criteria.
 *
 * Criteria:
 * 1. The name should have at least 10 characters.
 * 2. The name should start with a capital letter.
 * 3. The name should not contain any special characters (other than whitespace).
 * 4. The name should not end with a letter 'o' or 'y'.
 *
 * @param name The name of the potential firefighter.
 * @return True if the name is firefighter-worthy, False otherwise.
 */
fun isFirefighterWorthy(name: String): Boolean {

    if (name.length < 10) {
        return false
    }

    if (name[0].isLowerCase()) {
        return false
    }

    if (name.any { it.isLetter() && !it.isWhitespace() && !it.isLetterOrDigit() }) {
        return false
    }

    if (name.last() in listOf('o', 'y')) {
        return false
    }

    return true
}
/**
 * This function determines if a name belongs to a potential firefighter based on certain criteria.
 *
 * Criteria:
 * 1. The name should have at least 10 characters.
 * 2. The name should start with a capital letter.
 * 3. The name should not contain any special characters (other than whitespace).
 * 4. The name should not end with a letter 'o' or 'y'.
 *
 * @param name The name of the potential firefighter.
 * @return True if the name is firefighter-worthy, False otherwise.
 */
fun isFirefighterWorthy(name: String): Boolean {
/**
 * This function determines if a name belongs to a potential firefighter based on certain criteria.
 *
 * Criteria:
 * 1. The name should have at least 10 characters.
 * 2. The name should start with a capital letter.
 * 3. The name should not contain any special characters (other than whitespace).
 * 4. The name should not end with a letter 'o' or 'y'.
 *
 * @param name The name of the potential firefighter.
 * @return True if the name is firefighter-worthy, False otherwise.
 */
fun isFirefighterWorthy(name: String): Boolean {

    if (name.length < 10) {
        return false
    }

    if (name[0].isLowerCase()) {
        return false
    }

    if (name.any { it.isLetter() && !it.isWhitespace() && !it.isLetterOrDigit() }) {
        return false
    }

    if (name.last() in listOf('o', 'y')) {
        return false
    }

    return true
}