title: Find all possible combinations of a String representation of a number
body: <p>Given a mapping:</p>
  
  <pre><code>A: 1
  B: 2
  C: 3
  ...
  ...
  ...
  Z: 26
  </code></pre>
  
  <p>Find all possible ways a number can be represented. E.g. For an input: "121", we can represent it as:</p>
  
  <pre><code>ABA [using: 1 2 1]
  LA [using: 12 1]
  AU [using: 1 21]
  </code></pre>
  
  <p>I tried thinking about using some sort of a dynamic programming approach, but I am not sure how to proceed. I was asked this question in a technical interview.</p>
  
  <p>Here is a solution I could think of, please let me know if this looks good:</p>
  
  <pre><code>A[i]: Total number of ways to represent the sub-array number[0..i-1] using the integer to alphabet mapping.
  </code></pre>
  
  <p>Solution [am I missing something?]:</p>
  
  <pre><code>A[0] = 1 // there is only 1 way to represent the subarray consisting of only 1 number
  for(i = 1:A.size):
      A[i] = A[i-1]
      if(input[i-1]*10 + input[i] &lt; 26):
          A[i] += 1
      end
  end
  print A[A.size-1]
  </code></pre>