GenomicRangeQuery solved with JavaScript. This one was tough!

I finally found a solution to compute each test case in O(1), but the solution does not satisfy me. I may come back to this problem later.

Result:
https://codility.com/demo/results/demo53QCF4-5UK/