Java program to find the least non - overlapping number from a given set intervals
import java . util . * ; import java . io . * ; class GFG { static class Pair implements Comparable < Pair > { int start , end ; Pair ( int s , int e ) { start = s ; end = e ; } public int compareTo ( Pair p ) { return this . start - p . start ; } }