/**
 * Given a list of star data, return the index and the name of the stars
 * whose indices are divisible by 3. The star data is a list of tuples,
 * where each tuple contains the name of the star (String), its distance
 * from Earth (Float), and its luminosity (Float).
 *
 * @param starData The list of star data tuples
 * @return The list of indices and names of the stars whose indices are divisible by 3.
 */
fun sliceAndEnumerate(starData: List<Triple<String, Float, Float>>): List<Pair<Int, String>> {

    // Use withIndex to get the index and the star data tuple
    // Slice the starData to only consider every third element
    // Return a list of pairs containing the index and the name of the star
    
    return starData.withIndex()
        .filter { it.index % 3 == 0 }
        .map { Pair(it.index, it.value.first) }
}
/**
 * Given a list of star data, return the index and the name of the stars
 * whose indices are divisible by 3. The star data is a list of tuples,
 * where each tuple contains the name of the star (String), its distance
 * from Earth (Float), and its luminosity (Float).
 *
 * @param starData The list of star data tuples
 * @return The list of indices and names of the stars whose indices are divisible by 3.
 */
fun sliceAndEnumerate(starData: List<Triple<String, Float, Float>>): List<Pair<Int, String>> {
/**
 * Given a list of star data, return the index and the name of the stars
 * whose indices are divisible by 3. The star data is a list of tuples,
 * where each tuple contains the name of the star (String), its distance
 * from Earth (Float), and its luminosity (Float).
 *
 * @param starData The list of star data tuples
 * @return The list of indices and names of the stars whose indices are divisible by 3.
 */
fun sliceAndEnumerate(starData: List<Triple<String, Float, Float>>): List<Pair<Int, String>> {

    // Use withIndex to get the index and the star data tuple
    // Slice the starData to only consider every third element
    // Return a list of pairs containing the index and the name of the star
    
    return starData.withIndex()
        .filter { it.index % 3 == 0 }
        .map { Pair(it.index, it.value.first) }
}