/**
 * A fashion designer is organizing a fashion event and wants to know how many people will be attending.
 * Complete the function countPeopleInEvent to calculate the number of people attending the event.
 *
 * @param guestList A list of people attending the event.
 * @param eventCapacity The maximum number of people that can attend the event.
 * @return The number of people attending the event.
 *
 * Note:
 * If the guest list is empty or the event capacity is 0, the function should return 0.
 *
 * Example:
 * countPeopleInEvent(listOf("John", "Alice", "Kate"), 200) -> 3
 * countPeopleInEvent(emptyList(), 100) -> 0
 * countPeopleInEvent(listOf("Peter", "Emma", "Jack", "Olivia", "David"), 3) -> 3
 */
fun countPeopleInEvent(guestList: List<String>, eventCapacity: Int): Int {

    if (guestList.isEmpty() || eventCapacity == 0) {
        return 0
    }

    // Ensure the event capacity is not greater than the number of guests
    val actualCapacity = minOf(eventCapacity, guestList.size)

    return actualCapacity
}
/**
 * A fashion designer is organizing a fashion event and wants to know how many people will be attending.
 * Complete the function countPeopleInEvent to calculate the number of people attending the event.
 *
 * @param guestList A list of people attending the event.
 * @param eventCapacity The maximum number of people that can attend the event.
 * @return The number of people attending the event.
 *
 * Note:
 * If the guest list is empty or the event capacity is 0, the function should return 0.
 *
 * Example:
 * countPeopleInEvent(listOf("John", "Alice", "Kate"), 200) -> 3
 * countPeopleInEvent(emptyList(), 100) -> 0
 * countPeopleInEvent(listOf("Peter", "Emma", "Jack", "Olivia", "David"), 3) -> 3
 */
fun countPeopleInEvent(guestList: List<String>, eventCapacity: Int): Int {
/**
 * A fashion designer is organizing a fashion event and wants to know how many people will be attending.
 * Complete the function countPeopleInEvent to calculate the number of people attending the event.
 *
 * @param guestList A list of people attending the event.
 * @param eventCapacity The maximum number of people that can attend the event.
 * @return The number of people attending the event.
 *
 * Note:
 * If the guest list is empty or the event capacity is 0, the function should return 0.
 *
 * Example:
 * countPeopleInEvent(listOf("John", "Alice", "Kate"), 200) -> 3
 * countPeopleInEvent(emptyList(), 100) -> 0
 * countPeopleInEvent(listOf("Peter", "Emma", "Jack", "Olivia", "David"), 3) -> 3
 */
fun countPeopleInEvent(guestList: List<String>, eventCapacity: Int): Int {

    if (guestList.isEmpty() || eventCapacity == 0) {
        return 0
    }

    // Ensure the event capacity is not greater than the number of guests
    val actualCapacity = minOf(eventCapacity, guestList.size)

    return actualCapacity
}