title: max row sequence from sorted list for each index
body: <p>I have stored the input by index(a,b,c) and then in ascending order(by base sequence) as following:</p>
  
  <pre><code>input=['3a', '4a', '5a', '6a', 'Ca', 'Da', '4b','5b', '6b', '7b', '7c', '8c']
  </code></pre>
  
  <p>the sequence of numbers in my base in ascending order is:</p>
  
  <pre><code>"123456789ABCD"
  </code></pre>
  
  <p>Now what i want to do is select items that are in a row of length more than 4 for each index(a,b,c) and add them to the output list (i.e. find maximum row sequence for each index(a,b,c), actually I need all row combinations that are more than 4 for each index, but I have an idea how to make combinations if i find the MAX LEN row sequence for each index(a,b,c))</p>
  
  <p>so for input above the following output is expected:</p>
  
  <pre><code>[['3a','4a','5a','6a'],['4b','5b','6b','7b']]
  </code></pre>
  
  <p>here's the code I tried to use, code is in python:</p>
  
  <pre><code>input=['3a','4a','5a','6a','Ca','Da','4b','5b','6b','7b','7c','8c']
  digits = '123456789ABCD'
  digit_map = {d:i for i, d in enumerate(digits)}
  matches=[]
  temp=[]
  prev = 789
  print hands
  for n in input:
      if digit_map[n[0]] == prev + 1:
          matches.append(n)
          print matches
      else:
          if len(matches) &gt;= 4:
              temp.append(matches)
              print temp 
          matches = [n]
          print matches
      prev = digit_map[n[0]]
  print temp
  </code></pre>