/**
 * Given a list of astronomer information and a set of indices,
 * modify the elements of the list at the specified indices by
 * adding the index to the element.
 *
 * @param astronomerInfo A list of astronomer information.
 * @param indexSet A set of indices.
 * @return A modified list with elements at specified indices modified.
 *
 * Example:
 * // Input
 * val astronomerInfo = listOf("Galileo", "Hubble", "Kepler")
 * val indexSet = setOf(0, 2)
 *
 * // Output
 * ["Galileo0", "Hubble", "Kepler2"]
 */
fun modifyElements(astronomerInfo: List<String>, indexSet: Set<Int>): List<String> {

    return astronomerInfo.mapIndexed { index, element ->
        if (index in indexSet) {
            element + index
        } else {
            element
        }
    }
}
/**
 * Given a list of astronomer information and a set of indices,
 * modify the elements of the list at the specified indices by
 * adding the index to the element.
 *
 * @param astronomerInfo A list of astronomer information.
 * @param indexSet A set of indices.
 * @return A modified list with elements at specified indices modified.
 *
 * Example:
 * // Input
 * val astronomerInfo = listOf("Galileo", "Hubble", "Kepler")
 * val indexSet = setOf(0, 2)
 *
 * // Output
 * ["Galileo0", "Hubble", "Kepler2"]
 */
fun modifyElements(astronomerInfo: List<String>, indexSet: Set<Int>): List<String> {
/**
 * Given a list of astronomer information and a set of indices,
 * modify the elements of the list at the specified indices by
 * adding the index to the element.
 *
 * @param astronomerInfo A list of astronomer information.
 * @param indexSet A set of indices.
 * @return A modified list with elements at specified indices modified.
 *
 * Example:
 * // Input
 * val astronomerInfo = listOf("Galileo", "Hubble", "Kepler")
 * val indexSet = setOf(0, 2)
 *
 * // Output
 * ["Galileo0", "Hubble", "Kepler2"]
 */
fun modifyElements(astronomerInfo: List<String>, indexSet: Set<Int>): List<String> {

    return astronomerInfo.mapIndexed { index, element ->
        if (index in indexSet) {
            element + index
        } else {
            element
        }
    }
}