Not getting correct output

please check my code not getting correct output

hello @shivamgoel150 i have made all the necessary changes in your code . when you were calculating for the max lenght of the array with 1’s ,There to store the length we have to take separate variables to hande the length .
you were taking the same variables that were disturbing the left and right in your code .
rest there were small errors .
https://ide.codingblocks.com/s/321578.
i hope i have cleared your doubt .

if you feel that your doubt is cleared then please mark this as resolved…

Happy Learning !!