Kickstart round D- Alien Piano failed test case

What should be the output of the following sequence :

1 2 3 2 3 4 3 4 5 4 5 6 5

My output is 1, but the python code in the analysis tab gives 0. Why?

You can play the sequence like A, B, C, A, B, C, A, B, C, A, B, C, A without ever violating any rules. Thus the answer 0.


Thanks @kboitmanis , I was making a mistake of assigning the lower pitch sound to the strictly adjacent (-1) key and vice-versa. Hence I was going out of bound.

1 Like