since i is possible to form then another number is sum - i so mindifference is sum - i - i
} return 0 ; } var arr = [ 1 , 6 , 11 , 5 ] ; var n = arr . length ; document . write ( " " + minDifference ( arr , n ) + ' ' ) ;