Square roots and logarithms are connected: .
Dynamic programming builds solutions from smaller subproblems, and logarithms help analyze how many subproblems you have.
Time complexity depends on both the number of states () and the transitions per state (), giving total.