handled tricky cases for maximum consecutive subsequence