Forming smallest array with given constraints | Return the size of smallest array with given constraint . ; Drivers code
function minimumLength ( x , y , z ) { return 1 + Math . abs ( x - y ) + Math . abs ( y - z ) ; } var x = 3 , y = 1 , z = 2 ; document . write ( minimumLength ( x , y , z ) ) ;