For k=0, set st[i][0] = tourDepth[i] (minimum over range of length 1). For larger k, 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 2k splits into two ranges of length 2k−1. The first half starts at i, the second half starts at i+2k−1.
You compute this bottom-up: first all ranges of length 1, then length 2, then length 4, and so on. Each entry depends only on smaller powers, so the DP order is correct. Time: O(nlogn) because you fill a table of size n×logn, and each entry takes O(1) time to compute.