Driver program
var arr = [ 1 , 3 , 5 , 7 , 9 ] ; var n = arr . length ; var temp = Array ( 2 * n ) . fill ( 0 ) ; preprocess ( arr , n , temp ) ; var k = 2 ; leftRotate ( arr , n , k , temp ) ; k = 3 ; leftRotate ( arr , n , k , temp ) ; k = 4 ; leftRotate ( arr , n , k , temp ) ;