# LeetCode 326. Power of Three

Problem. This problem just like a IQ test question. You just need to check if the number is positive and can divide the largest power of 3 within the Int32…

# LeetCode 322. Coin Change

Problem. This is a very classic DP problem. The key observation is if you have a optimal solution S[m] for amount m, and your solution contains a coin C[j] then…

# LeetCode 313. Super Ugly Number

Problem. This is basically a math problem. The keep observation is for a ugly number U, if it can be divided by prime number P then U/P will also also…

# LeetCode 307. Range Sum Query – Mutable

Problem. This problem extends to previous 1D range query problem to allow hot update of the values. If we still use the same cache sum approach, we will end up…

# LeetCode 304. Range Sum Query 2D – Immutable

Problem To extend the 1D range query problem to 2D, we can still use the same cache approach but with a new “2D” formula. The new formula for calculating area E…

# LeetCode 303 – Range Sum Query – Immutable

Problem. This is a very straight forward rage cache problem since the only required operation is a range summation query. The way I handle this problem is to cache the…