/**
 * Given a list of athletes, iterate through each athlete and their respective records.
 * For each athlete, iterate through their records and multiply each record with the following pattern:
 *
 * - The first record is multiplied by 1, the second by 2, the third by 3, and so on.
 * - The next records of the athlete are multiplied by 1, 2, 3... n, where n represents the total number of records.
 *
 * Finally, return the modified list of athletes with their updated records.
 *
 * @param athleteList A list containing athletes.
 * @return The modified list of athletes with updated records.
 */
fun executeNestedLoops(athleteList: List<Map<String, Any>>): List<Map<String, Any>> {

    for (athlete in athleteList) {
        val records = athlete["records"] as MutableList<Int>
        val recordCount = records.size

        for (i in 0 until recordCount) {
            records[i] = records[i] * (i + 1)
        }
    }

    return athleteList
}
/**
 * Given a list of athletes, iterate through each athlete and their respective records.
 * For each athlete, iterate through their records and multiply each record with the following pattern:
 *
 * - The first record is multiplied by 1, the second by 2, the third by 3, and so on.
 * - The next records of the athlete are multiplied by 1, 2, 3... n, where n represents the total number of records.
 *
 * Finally, return the modified list of athletes with their updated records.
 *
 * @param athleteList A list containing athletes.
 * @return The modified list of athletes with updated records.
 */
fun executeNestedLoops(athleteList: List<Map<String, Any>>): List<Map<String, Any>> {
/**
 * Given a list of athletes, iterate through each athlete and their respective records.
 * For each athlete, iterate through their records and multiply each record with the following pattern:
 *
 * - The first record is multiplied by 1, the second by 2, the third by 3, and so on.
 * - The next records of the athlete are multiplied by 1, 2, 3... n, where n represents the total number of records.
 *
 * Finally, return the modified list of athletes with their updated records.
 *
 * @param athleteList A list containing athletes.
 * @return The modified list of athletes with updated records.
 */
fun executeNestedLoops(athleteList: List<Map<String, Any>>): List<Map<String, Any>> {

    for (athlete in athleteList) {
        val records = athlete["records"] as MutableList<Int>
        val recordCount = records.size

        for (i in 0 until recordCount) {
            records[i] = records[i] * (i + 1)
        }
    }

    return athleteList
}