Doubt In My Code

is line no. 24 necessary, because if an element is connecting two streaks, we are only interested in staring and ending point, and if an element is connecting two streaks then there must exist a streak which is already longer right?

@ksalokya kindly send the code again the link is not working.