/**
 * Given a string containing multiple names separated by spaces and a list of suffixes,
 * determine if any name in the string ends with any of the suffixes.
 *
 * @param names A string containing multiple names separated by spaces.
 * @param suffixes A list of suffixes to compare with the names.
 * @return True if any name ends with any of the suffixes, False otherwise.
 *
 * Example:
 * compareNames("John Doe Smith", listOf("II", "Jr", "Sr")) // true
 * compareNames("Alex Miller", listOf("III", "Esq")) // false
 */
fun compareNames(names: String, suffixes: List<String>): Boolean {

    // Split the string into individual names
    val nameList = names.split(" ")

    // Iterate over each name
    for (name in nameList) {
        // Iterate over each suffix
        for (suffix in suffixes) {
            // If the name ends with the suffix, return true
            if (name.endsWith(suffix)) {
                return true
            }
        }
    }
    return false
}
/**
 * Given a string containing multiple names separated by spaces and a list of suffixes,
 * determine if any name in the string ends with any of the suffixes.
 *
 * @param names A string containing multiple names separated by spaces.
 * @param suffixes A list of suffixes to compare with the names.
 * @return True if any name ends with any of the suffixes, False otherwise.
 *
 * Example:
 * compareNames("John Doe Smith", listOf("II", "Jr", "Sr")) // true
 * compareNames("Alex Miller", listOf("III", "Esq")) // false
 */
fun compareNames(names: String, suffixes: List<String>): Boolean {
/**
 * Given a string containing multiple names separated by spaces and a list of suffixes,
 * determine if any name in the string ends with any of the suffixes.
 *
 * @param names A string containing multiple names separated by spaces.
 * @param suffixes A list of suffixes to compare with the names.
 * @return True if any name ends with any of the suffixes, False otherwise.
 *
 * Example:
 * compareNames("John Doe Smith", listOf("II", "Jr", "Sr")) // true
 * compareNames("Alex Miller", listOf("III", "Esq")) // false
 */
fun compareNames(names: String, suffixes: List<String>): Boolean {

    // Split the string into individual names
    val nameList = names.split(" ")

    // Iterate over each name
    for (name in nameList) {
        // Iterate over each suffix
        for (suffix in suffixes) {
            // If the name ends with the suffix, return true
            if (name.endsWith(suffix)) {
                return true
            }
        }
    }
    return false
}