Well, that solution is still quadratic, but we can optimize it with a data structure. Take a look at the operations that we do over thecnt[]cnt[]array; we are taking the sum of a suffix, and updating a single position. What well-known data structure allows us to do those operations ...