Not sure to what extent this is a music theory or coding logic question. I'm keen on music theory and have probably an intermediate level of knowledge. I thought it was fun to think about coding and music together in this exercise.
My code passes all but the very last test which is for an octatonic scale. ("MmMmMmMm"). The tester and I disagree on whether this scale with a tonic of C should be written with sharps or flats. (I have flats, tester has sharps). To figure this out for other scales, I checked for the presence of the minor 3rd note in order to classify them as being more like a major or a minor scale so I can use the chart given in the instructions. (I realise in doing that I was using my own musical knowledge and not anything from the instructions -- I know the minor third note is what makes a minor chord sound "minor".) But this logic doesn't seem to work for this octatonic scale (with a tonic of C). When I google this scale I see it written with sharps, not flats, starting from C, so the test seems to reflect musical practice.
My question then is whether one is supposed to use different logic to classify the scales, or whether my logic is fine or mostly fine and the octatonic scale is an exception that needs to be treated separately, or if there is something else I'm missing about this exercise. Thanks!