title: HackerEarth Question solution failing for the input testcase
body: <p>Below hackerearth qn has been asked in one of coding qns</p>
  <p><strong>Farthest from zero</strong></p>
  <p>You are given an integer array A of size N.</p>
  <p><strong>Task</strong>
  Write a program to print the farthest element from 0.
  If there are multiple elements, print the number with the least value.</p>
  <p><strong>Input format</strong></p>
  <ul>
  <li>The first line contains a single integer N denoting the size of the
  array A.</li>
  <li>The next line contains N integers denoting the elements of    the
  array A.</li>
  </ul>
  <p><strong>Output format</strong></p>
  <p>Print the farthest element from 0.</p>
  <p><strong>Sample input 1</strong></p>
  <p>5</p>
  <p>1 2 3 4 5</p>
  <p><strong>Sample Output1</strong></p>
  <p>5</p>
  <p><strong>Solution prepared by me:</strong></p>
  <pre><code>public static farthestfromzero(int N, int [] Arr) {
      TreeSet&lt;Integer&gt; ts = new TreeSet&lt;Integer&gt;();
      for (int i=0; i&lt;N; i++){
            ts.add(Arr[i]);
      } 
    return ts.last();
  }
  </code></pre>
  <blockquote>
  <p><strong>Ask</strong>: This solution worked for me for the initial scenario, but when I
  submitted it , it didn't worked.</p>
  </blockquote>