title: Python: Produce all possible sequence combination from a list with character limit
body: <p>My question is exactly the same as <a href="https://stackoverflow.com/questions/27263155/python-find-all-possible-word-combinations-with-a-sequence-of-characters-word">this question</a>. I have the array (list) of characters. I would like to get all possible sequence combinations from that list but with <strong>the limit of characters</strong> (for example: 2 characters as maximum). Further, no single character can be repeated in a permutation line:</p>
  
  <pre><code>chars = ['a', 'b', 'c', 'd']
  
  # output
  output = [['a', 'b', 'c', 'd'],
            ['ab', 'c', 'd'],
            ['a', 'bc', 'd'],
            ['a', 'b', 'cd'],
            ['ab', 'cd'],
            ['abc', 'd'], # this one will be exempted
            ['a', 'bcd'],  # this one will be exempted
            ['abcd']]  # this one will be exempted
  </code></pre>
  
  <p>I know I can check the condition to omit the <strong>over-limit characters combinations</strong> while generating and building the sequence. But it will add the run time. My purpose is to reduce <strong>the existing execution time</strong>.</p>
  
  <p>Without the <strong>character count limitation</strong>, the combinations will be generated like 2^(N-1). If the list is over 15 characters, it will take too long to execute the program. Therefore I would like to reduce the combinations count by character limit. </p>
  
  <p>The priority is performance. I already research and tried for two days without any success.</p>