title: print outnum to the standard output stream sample input 5,10,6,8 sample output 4
body: <p>Consider an array of non-zero positive integers inarr. Identify and print a number outnum based on the below logic:</p>
  <p>· Across each of the possible ways in which integers in inarr can be sequentially arranged, identify the maximum absolute difference of adjacent values</p>
  <p>o The last and the first integers are adjacent</p>
  <p>· Print outnum, the minimum value across the maximum differences identified above</p>
  <p>Input:</p>
  <p>The first line represents the array inarr with its elements separated by ‘,’(comma)</p>
  <p>Read the inputs from the standard input stream</p>
  <p>Output:</p>
  <p>Print outnum to the standard output stream</p>
  <p>Sample Input    Sample Output   Explanation</p>
  <p>5,10,6,8    4</p>
  <p>For the given inarr, the maximum absolute difference of adjacent values for all the possible ways in which integers can be arranged is as below:</p>
  <p>5,10,6,8:</p>
  <p>5 - 10 =5  àabsolute maximum difference</p>
  <p>10 - 6 = 4</p>
  <p>6 - 8 =2</p>
  <p>8 - 5 =3</p>
  <p>Similarly, for other possible ways:</p>
  <p>5,10,8,6 - absolute max diff = 5</p>
  <p>5,6,8,10 - absolute max diff = 5</p>
  <p>5,6,10,8 - absolute max diff = 4</p>
  <p>5,8,6,10 - absolute max diff = 5</p>
  <p>5,8,10,6 - absolute max diff = 4</p>
  <p>10,5,6,8 - absolute max diff = 5</p>
  <p>10,5,8,6 - absolute max diff = 5</p>
  <p>10,6,5,8 - absolute max diff = 4</p>
  <p>10,6,8,5 - absolute max diff = 5</p>
  <p>10,8,6,5 - absolute max diff = 5</p>
  <p>10,8,5,6 - absolute max diff = 4</p>
  <p>6,5,10,8 - absolute max diff = 5</p>
  <p>6,5,8,10 - absolute max diff = 4</p>
  <p>6,8,5,10 - absolute max diff = 5</p>
  <p>6,8,10,5 - absolute max diff = 5</p>
  <p>6,10,5,8 - absolute max diff = 5</p>
  <p>6,10,8,5 - absolute max diff = 4</p>
  <p>8,5,6,10 - absolute max diff = 4</p>
  <p>8,5,10,6 - absolute max diff = 5</p>
  <p>8,6,5,10 - absolute max diff = 5</p>
  <p>8,6,10,5 - absolute max diff = 5</p>
  <p>8,10,5,6 - absolute max diff = 5</p>
  <p>8,10,6,5 - absolute max diff = 4</p>
  <p>The minimum value across the maximum differences is 4</p>