question: 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 ; }
target:  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.