Counting the number of intervals

Problem Name:
Counting the number of intervals
Site:HackerEarth
Links:
Tags:
Problem setters: