/**
 * Astronomers often need to calculate the distance between two stars.
 * You are given the names of two stars in the form of strings and need to
 * find the difference in their distances from the Earth, assuming Earth's distance is 1 unit.
 */
fun findStarDistance(star1: String, star2: String): String {

    // Convert the star names to lowercase for case-insensitive comparison
    var star1Lower = star1.toLowerCase()
    var star2Lower = star2.toLowerCase()

    // Define the distances of each star from Earth as floating point numbers
    val starDistances = mapOf(
        "alpha centauri" to 4.37,
        "sirius" to 8.58,
        "vega" to 25.05,
        "proxima centauri" to 4.24,
        "betelgeuse" to 643.0,
        "rigel" to 860.0,
        "betelgeuse b" to 293.0,
        "proxima centauri b" to 4.24
    )

    // Check if the given stars are in the map
    if (!starDistances.containsKey(star1Lower) || !starDistances.containsKey(star2Lower)) {
        return "Invalid star name(s)."
    }

    // Get the distances of the stars from the map
    val distance1 = starDistances.getValue(star1Lower)
    val distance2 = starDistances.getValue(star2Lower)

    // Calculate the difference in distances
    val distanceDifference = Math.abs(distance1 - distance2)

    return "The difference in distances between $star1 and $star2 is $distanceDifference units."
}
/**
 * Astronomers often need to calculate the distance between two stars.
 * You are given the names of two stars in the form of strings and need to
 * find the difference in their distances from the Earth, assuming Earth's distance is 1 unit.
 */
fun findStarDistance(star1: String, star2: String): String {
/**
 * Astronomers often need to calculate the distance between two stars.
 * You are given the names of two stars in the form of strings and need to
 * find the difference in their distances from the Earth, assuming Earth's distance is 1 unit.
 */
fun findStarDistance(star1: String, star2: String): String {

    // Convert the star names to lowercase for case-insensitive comparison
    var star1Lower = star1.toLowerCase()
    var star2Lower = star2.toLowerCase()

    // Define the distances of each star from Earth as floating point numbers
    val starDistances = mapOf(
        "alpha centauri" to 4.37,
        "sirius" to 8.58,
        "vega" to 25.05,
        "proxima centauri" to 4.24,
        "betelgeuse" to 643.0,
        "rigel" to 860.0,
        "betelgeuse b" to 293.0,
        "proxima centauri b" to 4.24
    )

    // Check if the given stars are in the map
    if (!starDistances.containsKey(star1Lower) || !starDistances.containsKey(star2Lower)) {
        return "Invalid star name(s)."
    }

    // Get the distances of the stars from the map
    val distance1 = starDistances.getValue(star1Lower)
    val distance2 = starDistances.getValue(star2Lower)

    // Calculate the difference in distances
    val distanceDifference = Math.abs(distance1 - distance2)

    return "The difference in distances between $star1 and $star2 is $distanceDifference units."
}