The problem , 814c , my approach was , for each segment [l, r ] , check whether its possible to color it with at most m colors or not.
since there can be 26*n queries and n^2 segments , the solution will work in 26*n^3 which will give TLE .
The editorial mentions some prefix based approach but i couldn't understand the 2nd part , how its optimizing the solution .
How to reduce 26 * n ^3 to 26*n ^2 .
is there any dp solution possible to it . ?