title: Iterating over arrays Boxes
body: <pre class="lang-java prettyprint-override"><code>import java.util.*;
  
  public class Main {
  
      public static void main(String[] args) {
          Scanner scanner = new Scanner(System.in);
          // Box 1 dimensions
          int x1 = scanner.nextInt();
          int y1 = scanner.nextInt();
          int z1 = scanner.nextInt();
          int[] box1 = {x1, y1, z1};
          Arrays.sort(box1);
          x1 = box1[0];
          y1 = box1[1];
          z1 = box1[2];
          // Box 2 dimensions
          int x2 = scanner.nextInt();
          int y2 = scanner.nextInt();
          int z2 = scanner.nextInt();
          int[] box2 = {x2, y2, z2};
          Arrays.sort(box2);
          x2 = box2[0];
          y2 = box2[1];
          z2 = box2[2];
          if (x1 &lt; x2) {
              if (y1 &lt;= y2) {
                  if (z1 &lt;= z2) {
                      System.out.println(&quot;Box 1 &lt; Box 2&quot;);
                  }
                  else {
                      System.out.println(&quot;Incompatible&quot;);
                  }
              }
              else {
                  System.out.println(&quot;Incompatible&quot;);
              }
          }
          else if (x1 &gt; x2) {
              if (y1 &gt;= y2) {
                  if (z1 &gt;= z2) {
                      System.out.println(&quot;Box 1 &gt; Box 2&quot;);
                  }
                  else {
                      System.out.println(&quot;Incompatible&quot;);
                  }
              }
              else {
                  System.out.println(&quot;Incompatible&quot;);
              }
          }
          else if (x1 == x2) {
              if (y1 &lt; y2) {
                  if (z1 &lt;= z2) {
                      System.out.println(&quot;Box 1 &lt; Box 2&quot;);
                  }
                  else {
                      System.out.println(&quot;Incompatible&quot;);
                  }
              }
              else if (y1 &gt; y2) {
                  if (z1 &gt;= z2) {
                      System.out.println(&quot;Box 1 &gt; Box 2&quot;);
                  }
                  else {
                      System.out.println(&quot;Incompatible&quot;);
                  }
              }
              else {
                  if (z1 &lt; z2) {
                      System.out.println(&quot;Box 1 &lt; Box 2&quot;);
                  }
                  else if (z1 &gt; z2) {
                      System.out.println(&quot;Box 1 &gt; Box 2&quot;);
                  }
                  else {
                      System.out.println(&quot;Box 1 = Box 2&quot;);
                  }
              }
          }
      }
  }
  </code></pre>
  <p>Can you help me to resolve your code?
  I think there are a little mistakes because :</p>
  <blockquote>
  <p>Failed test #3 of 7. Wrong answer</p>
  </blockquote>
  <p>This is a sample test from the problem statement!</p>
  <p>Test input:</p>
  <pre class="lang-none prettyprint-override"><code>1 3 7
  2 8 3
  </code></pre>
  <p>Correct output:<br />
  <code>Incompatible</code></p>
  <p>Your code output:<br />
  <code>Box 1 &lt; Box 2</code></p>