Algorithm · Karat · Easy
Each musical note is represented by two parts: a letter naming its pitch and a number giving its octave. To compare two notes, look at the octave first; only when the octaves are equal does the pitch letter decide which note is lower. You are given a song, expressed as a sequence of such notes, together with the lowest note and the highest note a particular singer can reach. Determine whether the singer can cover the whole song, that is, return whether every note of the song…