title: How many times can a list be split in a way that every element on the left is smaller than every element on the right?
body: <p>For example if the list is: [2,1,2,5,7,6,9] there's 3 possible ways of splitting:<br />
  [2,1,2] [5,7,6,9]<br />
  [2,1,2,5] [7,6,9]<br />
  [2,1,2,5,7,6] [9]</p>
  <p>I'm supposed to calculate how many times the list can be split in a way that every element on the left is smaller than every element on the right. So with this list, the output would be 3. <br />Here's my current solution:<br /></p>
  <pre><code>def count(t):
      c= 0
      for i in range(len(t)):
          try:
              if max(t[:i]) &lt; min(t[i:]):
                  c+=1
          except:
              continue
  
      return c
  </code></pre>
  <p>The above code does the right thing, but it's not of O(n) time complexity.
  How could I achieve the same result, but faster?</p>