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…

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…

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…

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…

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…

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…