title: Given a list of appointments, find all the conflicting appointments
body: <p>I have a question about finding the conflicting appointments.</p>
  <pre><code>Appointments: [[4,5], [2,3], [3,6], [5,7], [7,8]]
  Output: 
  [4,5] and [3,6] conflict. 
  [3,6] and [5,7] conflict. 
  </code></pre>
  <p>I tried to solve this question by myself, but failed. I did some google, however, I am not sure the answer is correct. Would you mind sharing your ideas in Python.
  My current thought is to sort the interval first, but not sure what to do next.
  Thanks for your help.</p>
  <p><strong>Updates</strong>:<br />
  I worked out the inefficient approach with O(n**2), and would like to look for the answer with O(nlogn). Thanks.</p>
  <p>Here is a test case helpful to reject your solution if it is slower than <code>O(nlgn)</code></p>
  <pre><code>n = 10
  intervals = []
  for i in range(n):
      intervals.append((i, n))
  print(intervals)
  
  </code></pre>