#shorts Day 9 || Find the maximum number of consecutive 1's in an array #dsa #array #algorithms

preview_player
Показать описание
In the video i have solved the problem to find the maximum number of consecutive 1's in an array where i am using a for loop to iterate through all the elements in an array if i am encountering 1 I am increasing the count of variable count by 1 and then storing the max of maxcount and count in maxcount variable if I am encountering 0 as arr[i] then I am setting value of count as 0 again in this way we will always get the value of maximum consecutive 1's in an array in the variable maxcount.
Рекомендации по теме
Комментарии
Автор

Nice code. I’m new to coding in real languages (I used scratch a lot) and these types of videos can be really helpful.

KittyKatIsMeow