/**
 * This exercise requires the athlete to loop through a set of sports and access the corresponding element in a list of athletes.
 *
 * @param athleteList A list of athletes.
 * @param sportSet A set of sports.
 * @return A message displaying the name of the athlete and the corresponding sport.
 */
fun accessAndLoop(athleteList: List<String>, sportSet: Set<String>): String {

    val message = StringBuilder()

    for (sport in sportSet) {  // Loop through each sport in the set
        for ((index, athlete) in athleteList.withIndex()) {  // Enumerate through the athlete list
            if (index % 2 == 0) {  // Check if the index is even
                // Append the name of the athlete and the corresponding sport to the message
                message.append("Athlete: $athlete, Sport: $sport\n")
            }
        }
    }

    return message.toString()
}
/**
 * This exercise requires the athlete to loop through a set of sports and access the corresponding element in a list of athletes.
 *
 * @param athleteList A list of athletes.
 * @param sportSet A set of sports.
 * @return A message displaying the name of the athlete and the corresponding sport.
 */
fun accessAndLoop(athleteList: List<String>, sportSet: Set<String>): String {
/**
 * This exercise requires the athlete to loop through a set of sports and access the corresponding element in a list of athletes.
 *
 * @param athleteList A list of athletes.
 * @param sportSet A set of sports.
 * @return A message displaying the name of the athlete and the corresponding sport.
 */
fun accessAndLoop(athleteList: List<String>, sportSet: Set<String>): String {

    val message = StringBuilder()

    for (sport in sportSet) {  // Loop through each sport in the set
        for ((index, athlete) in athleteList.withIndex()) {  // Enumerate through the athlete list
            if (index % 2 == 0) {  // Check if the index is even
                // Append the name of the athlete and the corresponding sport to the message
                message.append("Athlete: $athlete, Sport: $sport\n")
            }
        }
    }

    return message.toString()
}