Given an array with n elements , how to find the number of elements greater than or equal to a given value -LRB- x -RRB- in the given range index i to index j in O -LRB- log n -RRB- complexity ?
Count all n-digit numbers whose sum of digits equals to given sum ? How can we solve this problem ? How do we start to apply DP for problems like this ?