Driver code
public static void main ( String [ ] args ) { char S [ ] = " babab " . toCharArray ( ) ; char T [ ] = " babba " . toCharArray ( ) ; int m = S . length , n = T . length ; int ans = shortestSeq ( S , T , m , n ) ; if ( ans >= MAX ) ans = - 1 ; System . out . print ( " Length ▁ of ▁ shortest ▁ subsequence ▁ is : ▁ " + ans + "NEW_LINE"); } }