Driver Code
public static void main ( String [ ] args ) { String A = " aa " , B = " baaa " ; int N = A . length ( ) , M = B . length ( ) ; System . out . println ( numberofways ( A , B , N , M ) ) ; } }