/**
 * A code completion exercise to calculate the time taken by an athlete to complete a race of given distance.
 *
 * @param name The name of the athlete.
 * @param distance The distance of the race in meters.
 * @return The time taken by the athlete to complete the race in seconds.
 */
fun calculateTime(name: String, distance: Int): Float {

    val athleteName = name.reversed()  // Reverse the name of the athlete
    
    var totalTime = 0.0f
    for (i in 0 until distance) {
        totalTime += (i % athleteName.length)  // Consider the index of each character in the reversed name
    }
    
    return totalTime
}
/**
 * A code completion exercise to calculate the time taken by an athlete to complete a race of given distance.
 *
 * @param name The name of the athlete.
 * @param distance The distance of the race in meters.
 * @return The time taken by the athlete to complete the race in seconds.
 */
fun calculateTime(name: String, distance: Int): Float {
/**
 * A code completion exercise to calculate the time taken by an athlete to complete a race of given distance.
 *
 * @param name The name of the athlete.
 * @param distance The distance of the race in meters.
 * @return The time taken by the athlete to complete the race in seconds.
 */
fun calculateTime(name: String, distance: Int): Float {

    val athleteName = name.reversed()  // Reverse the name of the athlete
    
    var totalTime = 0.0f
    for (i in 0 until distance) {
        totalTime += (i % athleteName.length)  // Consider the index of each character in the reversed name
    }
    
    return totalTime
}