If size of the current rope is less than or equal to current maximum possible size + 1 , update the range to curSize + ropes [ i ]
if ( ropes [ i ] <= curSize + 1 ) { curSize = curSize + ropes [ i ] ; }