Sparse Table precomputes = answer for range starting at index with length .
st[i][0] = arr[i] # length 1
st[i][1] = min(st[i][0], st[i+1][0]) # length 2
st[i][2] = min(st[i][1], st[i+2][1]) # length 4
...
st[i][j] = min(st[i][j-1], st[i + 2^(j-1)][j-1])
Each entry combines two half-size ranges:
- Range combines and
Total entries: . Each computed in .
Preprocessing time: .