Comments

My bad!! Understood problem statement now.

Thanks :)

Can someone explain for Problem D:

Answer for input: bccdeefggiaacndddd

should be 2.

But according to solutions it is : 1

My solution for 2 is : (bc)(cd)(e(ef)g)(gi)(a(ac)n)dddd

Please help me in knowing what two values will change in the second segment tree.

May I know the source of this problem?