This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_chords(chords, music): | |
"""Search for chords within music (O(n) time). | |
:param list chords: chords to look for, in order | |
:param list music: music to search within | |
""" | |
if len(music) < len(chords): | |
return 0 | |
my_chord_i = -1 | |
occurrences = 0 | |
for my_chord in music: |