public boolean canAttendMeetings(Interval[] intervals){
  Arrays.sort(intervals,null);
  for (int i=1; i < intervals.length; i++) {
    if (intervals[i].start < intervals[i - 1].end) {
      return false;
    }
  }
  return true;
}

public boolean canAttendMeetings ( Interval [ ] intervals ) { Arrays . sort ( intervals , null ) ; for ( int i = 1 ; i < intervals . length ; i ++ ) { if ( intervals [ i ] . start < intervals [ i - 1 ] . end ) { return false ; } } return true ; }
sort . the actual problem is detecting whether there is any overlap between meetings . sort the intervals . from second interval , check each interval with the previous one . if current interval ' s start < previous interval ' s end , return false .
