title: Efficient Search through list of Ranges
body: <p>I have list of ranges { start, end }, and a value (point) , now I am looking for effective way to get last n th index from range in which given value is present.</p>
  
  <p>For example:
  List: [ { 0, 4 }, {5, 10 }, {11, 14 }, {15, 20} , {21, 25} ]
  n : 2
  value: 22</p>
  
  <p>So here, 22 is in range {21, 25 } which is at index 4 ( 0 based ). 
  and since n is 2, function should return index of {11, 14 } because this is n th range from matching range.</p>
  
  <p>Here, I can write binary function easily since I have sorted list of ranges. But I do not want to write while / for , I am looking for some C++ 11 / 14 algorithms / lambdas if available, which can solve this issue.</p>
  
  <p>What is an efficient solution?</p>