• + 0 comments

    He is just maintaining the max count when sum<=x

    You can do this by incrementing and decrementing "count" value when array[b] adding operation is going on, but it'll be difficult to remember max count! So, it is just a simpler way.