Structure to hold details of each interval
static class interval { int l , r , v ; } static class Sort implements Comparator < interval > { public int compare ( interval a , interval b ) { return ( a . v < b . v ? 1 : 0 ) ; } }