For , set st[i][0] = tourDepth[i] (minimum over range of length ). For larger , use the recurrence: st[i][k] = min(st[i][k-1], st[i + 2^(k-1)][k-1]). This works because a range of length splits into two ranges of length . The first half starts at , the second half starts at .
You compute this bottom-up: first all ranges of length , then length , then length , and so on. Each entry depends only on smaller powers, so the DP order is correct. Time: because you fill a table of size , and each entry takes time to compute.