public static void main(String args[]) {
        CountRanges cr = new CountRanges();
        int[] input = {0, 0};
        System.out.print(cr.countRangeSum(input, 0, 0));
    }
Date 03/03/2016
@author Tushar Roy

Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.

Time complexity O(nlogn)
Space complexity O(n)

Performance can be improved by using self balancing BST which keeps the count of key and size of substree under it

https://leetcode.com/problems/count-of-range-sum/
src/com/interview/misc/CountRanges.java