/**
 * Given a song and a note, this function returns the indices of the note in the song.
 *
 * @param song A string representing the musical notes of a song.
 * @param note A string representing the note to find the indices of.
 * @return A list of indices at which the given note occurs in the song.
 *
 * Example:
 * getNoteIndices("CDEFGABCDEFG", "G") returns [5, 12]
 * getNoteIndices("CDEFGABCDEFG", "A") returns [6, 13]
 */
fun getNoteIndices(song: String, note: String): List<Int> {

    val indices = mutableListOf<Int>()
    var index = 0

    while (index != -1) {
        index = song.indexOf(note, index)
        if (index != -1) {
            indices.add(index)
            index++
        }
    }

    return indices
}
/**
 * Given a song and a note, this function returns the indices of the note in the song.
 *
 * @param song A string representing the musical notes of a song.
 * @param note A string representing the note to find the indices of.
 * @return A list of indices at which the given note occurs in the song.
 *
 * Example:
 * getNoteIndices("CDEFGABCDEFG", "G") returns [5, 12]
 * getNoteIndices("CDEFGABCDEFG", "A") returns [6, 13]
 */
fun getNoteIndices(song: String, note: String): List<Int> {
/**
 * Given a song and a note, this function returns the indices of the note in the song.
 *
 * @param song A string representing the musical notes of a song.
 * @param note A string representing the note to find the indices of.
 * @return A list of indices at which the given note occurs in the song.
 *
 * Example:
 * getNoteIndices("CDEFGABCDEFG", "G") returns [5, 12]
 * getNoteIndices("CDEFGABCDEFG", "A") returns [6, 13]
 */
fun getNoteIndices(song: String, note: String): List<Int> {

    val indices = mutableListOf<Int>()
    var index = 0

    while (index != -1) {
        index = song.indexOf(note, index)
        if (index != -1) {
            indices.add(index)
            index++
        }
    }

    return indices
}