/**
 * Given a list of planets and a star, calculate the total distance between the star and each planet.
 *
 * @param planets A list of planet names as strings.
 * @param star The name of the star.
 * @return The total distance between the star and each planet.
 * @throws IllegalArgumentException If any of the planets or the star is not a string.
 */
fun calculateTotalDistance(planets: List<String>, star: String): Int {

    var totalDistance = 0

    for (planet in planets) {
        for (char in planet.indices) {
            totalDistance += planet[char].toInt() - star[char].toInt()
        }
    }

    return totalDistance
}
/**
 * Given a list of planets and a star, calculate the total distance between the star and each planet.
 *
 * @param planets A list of planet names as strings.
 * @param star The name of the star.
 * @return The total distance between the star and each planet.
 * @throws IllegalArgumentException If any of the planets or the star is not a string.
 */
fun calculateTotalDistance(planets: List<String>, star: String): Int {
/**
 * Given a list of planets and a star, calculate the total distance between the star and each planet.
 *
 * @param planets A list of planet names as strings.
 * @param star The name of the star.
 * @return The total distance between the star and each planet.
 * @throws IllegalArgumentException If any of the planets or the star is not a string.
 */
fun calculateTotalDistance(planets: List<String>, star: String): Int {

    var totalDistance = 0

    for (planet in planets) {
        for (char in planet.indices) {
            totalDistance += planet[char].toInt() - star[char].toInt()
        }
    }

    return totalDistance
}