Java implementation of the above approach
import java . util . Arrays ; import java . util . Comparator ; public class MinimumCirclesTobeRemoved { private class Circle implements Comparator < Circle > { int start ; int end ;