Driver code
let n = 4 ; let a1 = [ 1 , 1 , 0 , 0 ] ; document . write ( no_of_ways ( a1 , n ) + " " ) ; n = 5 ; let a2 = [ 1 , 1 , 1 , 0 , 0 ] ; document . write ( no_of_ways ( a2 , n ) + " " ) ; n = 5 ; let a3 = [ 1 , 1 , 0 , 0 , 0 ] ; document . write ( no_of_ways ( a3 , n ) + " " ) ; n = 6 ; let a4 = [ 1 , 1 , 1 , 0 , 0 , 0 ] ; document . write ( no_of_ways ( a4 , n ) + " " ) ;