/**
 * In this exercise, you need to implement a function that counts the number of customers
 * who have email addresses ending with the specified target domains.
 *
 * @param emails A list of strings representing customer email addresses.
 * @param targetDomains A list of strings representing the target email domains.
 * @return The count of customers whose email addresses end with any of the target domains.
 *
 * Example:
 * countCustomers(listOf("john@example.com", "jane@example.com", "mike@company.com", "tom@blog.net"),
 *                listOf("example.com", "blog.net"))
 * Output: 3 (since "john@example.com", "jane@example.com", and "tom@blog.net" match the target domains)
 */
fun countCustomers(emails: List<String>, targetDomains: List<String>): Int {

    var count = 0
    for (email in emails) {
        if (targetDomains.any { email.endsWith(it) }) {
            count++
        }
    }
    return count
}
/**
 * In this exercise, you need to implement a function that counts the number of customers
 * who have email addresses ending with the specified target domains.
 *
 * @param emails A list of strings representing customer email addresses.
 * @param targetDomains A list of strings representing the target email domains.
 * @return The count of customers whose email addresses end with any of the target domains.
 *
 * Example:
 * countCustomers(listOf("john@example.com", "jane@example.com", "mike@company.com", "tom@blog.net"),
 *                listOf("example.com", "blog.net"))
 * Output: 3 (since "john@example.com", "jane@example.com", and "tom@blog.net" match the target domains)
 */
fun countCustomers(emails: List<String>, targetDomains: List<String>): Int {
/**
 * In this exercise, you need to implement a function that counts the number of customers
 * who have email addresses ending with the specified target domains.
 *
 * @param emails A list of strings representing customer email addresses.
 * @param targetDomains A list of strings representing the target email domains.
 * @return The count of customers whose email addresses end with any of the target domains.
 *
 * Example:
 * countCustomers(listOf("john@example.com", "jane@example.com", "mike@company.com", "tom@blog.net"),
 *                listOf("example.com", "blog.net"))
 * Output: 3 (since "john@example.com", "jane@example.com", and "tom@blog.net" match the target domains)
 */
fun countCustomers(emails: List<String>, targetDomains: List<String>): Int {

    var count = 0
    for (email in emails) {
        if (targetDomains.any { email.endsWith(it) }) {
            count++
        }
    }
    return count
}