/**
 * Given a list of notes played by a musician and the musician's name, this function deletes
 * all the notes from the list if the musician's name is not provided or is null.
 *
 * @param notesList A list of notes played by a musician.
 * @param musicianName The name of the musician.
 * @return The updated list of notes after deletion.
 */
fun deleteNotes(notesList: MutableList<String>, musicianName: String?): MutableList<String> {

    if (musicianName == null) {
        notesList.clear()
    } else {
        val iterator = notesList.iterator()
        while (iterator.hasNext()) {
            if (iterator.next() == "delete") {
                iterator.remove()
            }
        }
    }
    return notesList
}
/**
 * Given a list of notes played by a musician and the musician's name, this function deletes
 * all the notes from the list if the musician's name is not provided or is null.
 *
 * @param notesList A list of notes played by a musician.
 * @param musicianName The name of the musician.
 * @return The updated list of notes after deletion.
 */
fun deleteNotes(notesList: MutableList<String>, musicianName: String?): MutableList<String> {
/**
 * Given a list of notes played by a musician and the musician's name, this function deletes
 * all the notes from the list if the musician's name is not provided or is null.
 *
 * @param notesList A list of notes played by a musician.
 * @param musicianName The name of the musician.
 * @return The updated list of notes after deletion.
 */
fun deleteNotes(notesList: MutableList<String>, musicianName: String?): MutableList<String> {

    if (musicianName == null) {
        notesList.clear()
    } else {
        val iterator = notesList.iterator()
        while (iterator.hasNext()) {
            if (iterator.next() == "delete") {
                iterator.remove()
            }
        }
    }
    return notesList
}