Driver Code
var N = 2 , M = 3 ; var A = [ 1 , 2 ] ; var B = [ 1 , 2 , 3 ] ; for ( i = 0 ; i < 205 ; i ++ ) prefix_2D [ i ] = Array ( 205 ) . fill ( 0 ) ; var K = 1 ; document . write ( numberOfWays ( A , B , N , M , K ) ) ;