title: Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers
body: <p>The code doesn't pass all the tests, only passes 5 tests.
  One of the failed test cases</p>
  <p>Wrong Answer</p>
  <p><strong>Input (stdin)</strong></p>
  <p><code>793810624 895642170 685903712 623789054 468592370</code></p>
  <p><strong>Expected Output</strong></p>
  <p><code>2572095760 2999145560</code></p>
  <pre class="lang-java prettyprint-override"><code>public class Solution {
      public static void main(String args[]) {
          Scanner sc = new Scanner(System.in);
      
          //initialize array
          int arr[]=new int[5];
          int sum=0;
  
          //array elements
          for(int i=0;i&lt;5;i++)
          {
              arr[i] = sc.nextInt();
              sum+=arr[i];           
          }
      
          //Sorting the array and storing the minimum and maximum values
          Arrays.sort(arr);
          int min=arr[4];
          int max=arr[0];
          int minSum = sum-min;
          int maxSum = sum-max;
          System.out.println(minSum+&quot; &quot;+maxSum);
      }
  }
  </code></pre>