Are you failing Jovian’s submission test?
Because there are 4 cases with no rotation with
0 as output,
But I think Jovian accepts
output for cases when no rotation takes place.
So, you can change the
output in your test cases, and in your code might wanna return
-1 when no rotation takes place.