How do I find a maximum number of consecutive non-zero values in the array?

Im sorry, still not that clear. But my idea is to use if -else ?

1 Like