title: Sorting result array
body: <p>I was asked this question in Adobe interview: </p>
  
  <p>We have an integer array that is sorted in ascending order. We also have 3 integers <code>A</code>, <code>B</code> and <code>C</code>. We need to apply <code>A*x*x + B*x + C</code> for each element <code>x</code> in the array and return the corresponding sorted array.</p>
  
  <p>Example I was given: </p>
  
  <pre><code>Input array = -1 0 1 2 3 4
  A = -1, B = 2, C = -1`
  </code></pre>
  
  <p>Result of applying the formula to each element = <code>-4 -1 0 -1 -4 -9</code><br>
  So expected result = <code>-9 -4 -4 -1 -1 0</code> (sorted)</p>
  
  <p>My best solution was to apply formula and sort it resulting in <code>O(nlogn)</code> solution. I could not do it better. </p>
  
  <p>Any guidance in improving it is helpful.</p>