title: Why is the output of this code 3 for the below test case?
body: <p>My coding question has to do with counting the minimum number of rooms given scheduling times</p>
  
  <p>Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si &lt; ei), find the minimum number of conference rooms required.
  Example
  Example1
  Input: intervals = [(0,30),(5,10),(15,20)]
  Output: 2
  Explanation:
  We need two meeting rooms
  room1: (0,30)
  room2: (5,10),(15,20)
  Example2
  Input: intervals = [(2,7)]
  Output: 1
  Explanation: 
  Only need one meeting room</p>
  
  <p>This is the test case I am trying so solve: [(65,424),(351,507),(314,807),(387,722),(19,797),(259,722),(165,221)]</p>
  
  <p>The output is supposed to be 6, but my code is returning 3 and I am not sure why.</p>
  
  <p>When I ran this test case, [(65,424),(351,507),(314,807),(387,722),(19,797),(259,722)], my solution prints 6, however, as soon as I add (165,221), the solution prints 3.</p>
  
  <p>``
  The code is below: </p>
  
  <pre><code>/**
   *Definition of Interval:
   * public classs Interval {
   *     int start, end;
   *     Interval(int start, int end) {
   *         this.start = start;
   *         this.end = end;
   *     }
   * }
   */
  
  public class Solution {
      /**
       * @param intervals: an array of meeting time intervals
       * @return: the minimum number of conference rooms required
       */
  
  public int minMeetingRooms(List&lt;Interval&gt; intervals) {
          // Write your code here
          if(intervals.size() == 0 || intervals == null) {
              return 0;
          }
  
          Interval[] interArr = new Interval[intervals.size()];
          interArr = intervals.toArray(interArr);
          Arrays.sort(interArr, (a,b) -&gt; a.start - b.start);
          PriorityQueue&lt;Integer&gt; pq = new PriorityQueue&lt;&gt;();
          pq.add(interArr[0].end);
          for(int i = 1; i &lt; interArr.length; i++) {
              Interval curr = interArr[i];
              if (curr.start &lt; pq.peek()) {
                  pq.add(interArr[i].end);
              }
          }
          return pq.size();
      }
  }
  
  ``
  </code></pre>