/**
 * Given a list of musical notes represented as strings and a duration value,
 * remove all the notes from the list that have a duration lower than the given duration.
 *
 * @param notes A list of musical notes represented as strings.
 * @param duration An integer representing the minimum duration required to keep a note.
 * @return A list of musical notes that have a duration higher or equal to the given duration.
 *
 * Example:
 * removeNotes(listOf("C", "D", "E", "F", "G"), 2) => listOf("C", "D", "E")
 * removeNotes(listOf("A", "B", "C"), 4) => emptyList()
 * removeNotes(listOf("D", "E", "F", "G"), 3) => listOf("D", "E")
 */
fun removeNotes(notes: List<String>, duration: Int): List<String> {

    // Use filter to remove notes based on duration
    return notes.filter { 60 / it.substring(1).toInt() >= duration }
}
/**
 * Given a list of musical notes represented as strings and a duration value,
 * remove all the notes from the list that have a duration lower than the given duration.
 *
 * @param notes A list of musical notes represented as strings.
 * @param duration An integer representing the minimum duration required to keep a note.
 * @return A list of musical notes that have a duration higher or equal to the given duration.
 *
 * Example:
 * removeNotes(listOf("C", "D", "E", "F", "G"), 2) => listOf("C", "D", "E")
 * removeNotes(listOf("A", "B", "C"), 4) => emptyList()
 * removeNotes(listOf("D", "E", "F", "G"), 3) => listOf("D", "E")
 */
fun removeNotes(notes: List<String>, duration: Int): List<String> {
/**
 * Given a list of musical notes represented as strings and a duration value,
 * remove all the notes from the list that have a duration lower than the given duration.
 *
 * @param notes A list of musical notes represented as strings.
 * @param duration An integer representing the minimum duration required to keep a note.
 * @return A list of musical notes that have a duration higher or equal to the given duration.
 *
 * Example:
 * removeNotes(listOf("C", "D", "E", "F", "G"), 2) => listOf("C", "D", "E")
 * removeNotes(listOf("A", "B", "C"), 4) => emptyList()
 * removeNotes(listOf("D", "E", "F", "G"), 3) => listOf("D", "E")
 */
fun removeNotes(notes: List<String>, duration: Int): List<String> {

    // Use filter to remove notes based on duration
    return notes.filter { 60 / it.substring(1).toInt() >= duration }
}