/**
 * Given a list of artists and two indices (start_index and end_index),
 * modify the artists list by removing elements from the start_index (inclusive)
 * to the end_index (exclusive). Then, return the resulting modified artists list.
 *
 * @param artistList A list of artists.
 * @param startIndex The index representing the starting position (inclusive) for removing elements.
 * @param endIndex The index representing the ending position (exclusive) for removing elements.
 * @return The modified artists list after removing elements.
 *
 * Example:
 * modifyArtist(listOf("Lil Nas X", "Justin Bieber", "Beyonce", "Ariana Grande", "Taylor Swift"), 1, 4)
 * Output: ['Lil Nas X', 'Taylor Swift']
 */
fun modifyArtist(artistList: List<String>, startIndex: Int, endIndex: Int): List<String> {

    // Modify the artist list by slicing it and removing elements
    val modifiedList = artistList.subList(0, startIndex) + artistList.subList(endIndex, artistList.size)
    return modifiedList
}
/**
 * Given a list of artists and two indices (start_index and end_index),
 * modify the artists list by removing elements from the start_index (inclusive)
 * to the end_index (exclusive). Then, return the resulting modified artists list.
 *
 * @param artistList A list of artists.
 * @param startIndex The index representing the starting position (inclusive) for removing elements.
 * @param endIndex The index representing the ending position (exclusive) for removing elements.
 * @return The modified artists list after removing elements.
 *
 * Example:
 * modifyArtist(listOf("Lil Nas X", "Justin Bieber", "Beyonce", "Ariana Grande", "Taylor Swift"), 1, 4)
 * Output: ['Lil Nas X', 'Taylor Swift']
 */
fun modifyArtist(artistList: List<String>, startIndex: Int, endIndex: Int): List<String> {
/**
 * Given a list of artists and two indices (start_index and end_index),
 * modify the artists list by removing elements from the start_index (inclusive)
 * to the end_index (exclusive). Then, return the resulting modified artists list.
 *
 * @param artistList A list of artists.
 * @param startIndex The index representing the starting position (inclusive) for removing elements.
 * @param endIndex The index representing the ending position (exclusive) for removing elements.
 * @return The modified artists list after removing elements.
 *
 * Example:
 * modifyArtist(listOf("Lil Nas X", "Justin Bieber", "Beyonce", "Ariana Grande", "Taylor Swift"), 1, 4)
 * Output: ['Lil Nas X', 'Taylor Swift']
 */
fun modifyArtist(artistList: List<String>, startIndex: Int, endIndex: Int): List<String> {

    // Modify the artist list by slicing it and removing elements
    val modifiedList = artistList.subList(0, startIndex) + artistList.subList(endIndex, artistList.size)
    return modifiedList
}