/**
 * Given a list of notes, replace all occurrences of the oldNote with the newNote.
 *
 * @param notes A list of notes.
 * @param oldNote The note to be replaced.
 * @param newNote The note to replace the oldNote.
 * @return A new list with all occurrences of the oldNote replaced by the newNote.
 */
fun replaceNote(notes: MutableList<String>, oldNote: String, newNote: String): List<String> {

    // Iterate through the notes list and replace all occurrences of the oldNote
    for (i in notes.indices) {
        if (notes[i] == oldNote) {
            notes[i] = newNote
        }
    }
    return notes
}
/**
 * Given a list of notes, replace all occurrences of the oldNote with the newNote.
 *
 * @param notes A list of notes.
 * @param oldNote The note to be replaced.
 * @param newNote The note to replace the oldNote.
 * @return A new list with all occurrences of the oldNote replaced by the newNote.
 */
fun replaceNote(notes: MutableList<String>, oldNote: String, newNote: String): List<String> {
/**
 * Given a list of notes, replace all occurrences of the oldNote with the newNote.
 *
 * @param notes A list of notes.
 * @param oldNote The note to be replaced.
 * @param newNote The note to replace the oldNote.
 * @return A new list with all occurrences of the oldNote replaced by the newNote.
 */
fun replaceNote(notes: MutableList<String>, oldNote: String, newNote: String): List<String> {

    // Iterate through the notes list and replace all occurrences of the oldNote
    for (i in notes.indices) {
        if (notes[i] == oldNote) {
            notes[i] = newNote
        }
    }
    return notes
}