/**
 * As a Marketing Manager, you need to select the target audience for a new product.
 * This function takes in three parameters:
 * - products: a list of available products
 * - demographic: a specified demographic for the target audience
 * - audienceSize: the desired size of the target audience
 *
 * Your task is to:
 * 1. Check if the specified demographic is available for selection in the products list.
 * 2. If it is available, check if the audience size is less than or equal to the total audience size for that demographic.
 * 3. Return true if both conditions are satisfied, otherwise return false.
 *
 * For example:
 * selectTargetAudience(listOf("Product A", "Product B"), "18-24", 1000) should return true,
 * but selectTargetAudience(listOf("Product A", "Product B"), "25-34", 500) should return false.
 */
fun selectTargetAudience(products: List<String>, demographic: String, audienceSize: Int): Boolean {

    val productsMap = mapOf(
        "18-24" to 2000,
        "25-34" to 1500
    )

    val totalAudienceSize = productsMap[demographic]
    return totalAudienceSize != null && audienceSize <= totalAudienceSize
}
/**
 * As a Marketing Manager, you need to select the target audience for a new product.
 * This function takes in three parameters:
 * - products: a list of available products
 * - demographic: a specified demographic for the target audience
 * - audienceSize: the desired size of the target audience
 *
 * Your task is to:
 * 1. Check if the specified demographic is available for selection in the products list.
 * 2. If it is available, check if the audience size is less than or equal to the total audience size for that demographic.
 * 3. Return true if both conditions are satisfied, otherwise return false.
 *
 * For example:
 * selectTargetAudience(listOf("Product A", "Product B"), "18-24", 1000) should return true,
 * but selectTargetAudience(listOf("Product A", "Product B"), "25-34", 500) should return false.
 */
fun selectTargetAudience(products: List<String>, demographic: String, audienceSize: Int): Boolean {
/**
 * As a Marketing Manager, you need to select the target audience for a new product.
 * This function takes in three parameters:
 * - products: a list of available products
 * - demographic: a specified demographic for the target audience
 * - audienceSize: the desired size of the target audience
 *
 * Your task is to:
 * 1. Check if the specified demographic is available for selection in the products list.
 * 2. If it is available, check if the audience size is less than or equal to the total audience size for that demographic.
 * 3. Return true if both conditions are satisfied, otherwise return false.
 *
 * For example:
 * selectTargetAudience(listOf("Product A", "Product B"), "18-24", 1000) should return true,
 * but selectTargetAudience(listOf("Product A", "Product B"), "25-34", 500) should return false.
 */
fun selectTargetAudience(products: List<String>, demographic: String, audienceSize: Int): Boolean {

    val productsMap = mapOf(
        "18-24" to 2000,
        "25-34" to 1500
    )

    val totalAudienceSize = productsMap[demographic]
    return totalAudienceSize != null && audienceSize <= totalAudienceSize
}