Driver code
public static void main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 } ; int n = arr . length ; int [ ] b = solve ( arr , n ) ; System . out . println ( Arrays . toString ( b ) ) ; } }