/**
 * This exercise focuses on appending elements to a list and indexing.
 *
 * Given a list of songs and a new song, append the new song to the end of the list.
 * Then, find the index of the first occurrence of the new song in the list.
 *
 * @param songList A list of songs.
 * @param newSong The new song to be appended.
 * @return The index of the first occurrence of the new song in the list.
 *
 * Example:
 * songs = ["Song A", "Song B", "Song C"]
 * newSong = "Song D"
 * appendAndIndexSong(songs, newSong) // Output: 3
 */
fun appendAndIndexSong(songList: MutableList<String>, newSong: String): Int {

    // Append the new song to the end of the list
    songList.add(newSong)

    // Find the index of the first occurrence of the new song
    val index = songList.indexOf(newSong)

    return index
}
/**
 * This exercise focuses on appending elements to a list and indexing.
 *
 * Given a list of songs and a new song, append the new song to the end of the list.
 * Then, find the index of the first occurrence of the new song in the list.
 *
 * @param songList A list of songs.
 * @param newSong The new song to be appended.
 * @return The index of the first occurrence of the new song in the list.
 *
 * Example:
 * songs = ["Song A", "Song B", "Song C"]
 * newSong = "Song D"
 * appendAndIndexSong(songs, newSong) // Output: 3
 */
fun appendAndIndexSong(songList: MutableList<String>, newSong: String): Int {
/**
 * This exercise focuses on appending elements to a list and indexing.
 *
 * Given a list of songs and a new song, append the new song to the end of the list.
 * Then, find the index of the first occurrence of the new song in the list.
 *
 * @param songList A list of songs.
 * @param newSong The new song to be appended.
 * @return The index of the first occurrence of the new song in the list.
 *
 * Example:
 * songs = ["Song A", "Song B", "Song C"]
 * newSong = "Song D"
 * appendAndIndexSong(songs, newSong) // Output: 3
 */
fun appendAndIndexSong(songList: MutableList<String>, newSong: String): Int {

    // Append the new song to the end of the list
    songList.add(newSong)

    // Find the index of the first occurrence of the new song
    val index = songList.indexOf(newSong)

    return index
}