/**
 * This function checks if a person is a member of a specific group based on their age or their name.
 *
 * @param people a list containing tuples representing people, where each tuple consists of the person's age as an integer and their name as a string.
 * @return membershipList a list containing the names of people who are members of the group.
 */
fun checkMembership(people: List<Pair<Int, String>>): List<String> {

    // Create an empty list to store the names of members
    val membershipList = mutableListOf<String>()

    // Iterate through each person in the given list
    for (person in people) {
        val (age, name) = person

        // Check if the age is between 18 and 30 (inclusive) OR the name contains the letter 'j'
        if ((age in 18..30) || 'j' in name.toLowerCase()) {
            membershipList.add(name)
        }
    }

    return membershipList
}
/**
 * This function checks if a person is a member of a specific group based on their age or their name.
 *
 * @param people a list containing tuples representing people, where each tuple consists of the person's age as an integer and their name as a string.
 * @return membershipList a list containing the names of people who are members of the group.
 */
fun checkMembership(people: List<Pair<Int, String>>): List<String> {
/**
 * This function checks if a person is a member of a specific group based on their age or their name.
 *
 * @param people a list containing tuples representing people, where each tuple consists of the person's age as an integer and their name as a string.
 * @return membershipList a list containing the names of people who are members of the group.
 */
fun checkMembership(people: List<Pair<Int, String>>): List<String> {

    // Create an empty list to store the names of members
    val membershipList = mutableListOf<String>()

    // Iterate through each person in the given list
    for (person in people) {
        val (age, name) = person

        // Check if the age is between 18 and 30 (inclusive) OR the name contains the letter 'j'
        if ((age in 18..30) || 'j' in name.toLowerCase()) {
            membershipList.add(name)
        }
    }

    return membershipList
}