X = SORTED (m = 6), Y = STORE (n = 5)
  c[1,1]  x1=S y1=S  match:    c[0,0]+1 = 1  D
  c[1,2]  x1=S y2=T  no match: max(up 0, left 1) = 1  L
  c[1,3]  x1=S y3=O  no match: max(up 0, left 1) = 1  L
  c[1,4]  x1=S y4=R  no match: max(up 0, left 1) = 1  L
  c[1,5]  x1=S y5=E  no match: max(up 0, left 1) = 1  L
  c[2,1]  x2=O y1=S  no match: max(up 1, left 0) = 1  U
  c[2,2]  x2=O y2=T  no match: max(up 1, left 1) = 1  U
  c[2,3]  x2=O y3=O  match:    c[1,2]+1 = 2  D
  c[2,4]  x2=O y4=R  no match: max(up 1, left 2) = 2  L
  c[2,5]  x2=O y5=E  no match: max(up 1, left 2) = 2  L
  c[3,1]  x3=R y1=S  no match: max(up 1, left 0) = 1  U
  c[3,2]  x3=R y2=T  no match: max(up 1, left 1) = 1  U
  c[3,3]  x3=R y3=O  no match: max(up 2, left 1) = 2  U
  c[3,4]  x3=R y4=R  match:    c[2,3]+1 = 3  D
  c[3,5]  x3=R y5=E  no match: max(up 2, left 3) = 3  L
  c[4,1]  x4=T y1=S  no match: max(up 1, left 0) = 1  U
  c[4,2]  x4=T y2=T  match:    c[3,1]+1 = 2  D
  c[4,3]  x4=T y3=O  no match: max(up 2, left 2) = 2  U
  c[4,4]  x4=T y4=R  no match: max(up 3, left 2) = 3  U
  c[4,5]  x4=T y5=E  no match: max(up 3, left 3) = 3  U
  c[5,1]  x5=E y1=S  no match: max(up 1, left 0) = 1  U
  c[5,2]  x5=E y2=T  no match: max(up 2, left 1) = 2  U
  c[5,3]  x5=E y3=O  no match: max(up 2, left 2) = 2  U
  c[5,4]  x5=E y4=R  no match: max(up 3, left 2) = 3  U
  c[5,5]  x5=E y5=E  match:    c[4,4]+1 = 4  D
  c[6,1]  x6=D y1=S  no match: max(up 1, left 0) = 1  U
  c[6,2]  x6=D y2=T  no match: max(up 2, left 1) = 2  U
  c[6,3]  x6=D y3=O  no match: max(up 2, left 2) = 2  U
  c[6,4]  x6=D y4=R  no match: max(up 3, left 2) = 3  U
  c[6,5]  x6=D y5=E  no match: max(up 4, left 3) = 4  U
      j:   0    1    2    3    4    5  
                S    T    O    R    E  
  i=0      0    0    0    0    0    0  
  i=1 S    0    1D   1L   1L   1L   1L 
  i=2 O    0    1U   1U   2D   2L   2L 
  i=3 R    0    1U   1U   2U   3D   3L 
  i=4 T    0    1U   2D   2U   3U   3U 
  i=5 E    0    1U   2U   2U   3U   4D 
  i=6 D    0    1U   2U   2U   3U   4U 
  at (6,5) arrow U
  at (5,5) arrow D  take E
  at (4,4) arrow U
  at (3,4) arrow D  take R
  at (2,3) arrow D  take O
  at (1,2) arrow L
  at (1,1) arrow D  take S
  LCS length = 4, one LCS = SORE

Check yourself
X = HEAPS (m = 5), Y = SHAPE (n = 5)
      j:   0    1    2    3    4    5  
                S    H    A    P    E  
  i=0      0    0    0    0    0    0  
  i=1 H    0    0U   1D   1L   1L   1L 
  i=2 E    0    0U   1U   1U   1U   2D 
  i=3 A    0    0U   1U   2D   2L   2U 
  i=4 P    0    0U   1U   2U   3D   3L 
  i=5 S    0    1D   1U   2U   3U   3U 
  LCS length = 3, one LCS = HAP
