title: Longest common subsequence implementation-python
body: <p>I have implemented the longest common subsequence problem as instructed in this <a href="https://www.youtube.com/watch?v=xnWqLAI3TKs" rel="nofollow">video</a>. It just execute first set of code and produces an empty list. What is wrong with this implementation?</p>
  
  <pre><code>def lcs_recursive(xlist,ylist):
      if not xlist or ylist:
          return []
      x,xs,y,ys, = xlist[0],xlist[1:],ylist[0],ylist[1:]
      if x == y:
          return [x] + lcs_recursive(xs,ys)
      else:
          return max(lcs_recursive(xlist,ys),lcs_recursive(xs,ylist),key=len)
  
  
  
  s1 = 'abc'
  s2 = 'aeb'
  
  print lcs_recursive(s1,s2) 
  </code></pre>