Skip to content

When the state is a range rather than a position

Some problems define the state as best[i][j], meaning the answer for the range from i to j.

When is that the right state?