Given a sorted array (e.g., x= [-2 , 0 ,2]) and a quadratic equation y= a*x^2 + b*x + c (a, b, c are integer constants, and a != 0). Return the y array in ascending order.

```
public class solution{
public int[] solve(int[] nums, int a, int b, int c){
if(nums == null || nums.length == 0)
return null;
int length = nums.length;
int leftIndex = 0;
int rightIndex = length - 1;
#assume that a is less than 0
int[] result = new int[length];
int resultIndex = 0;
#if a < 0
while(leftIndex <= rightIndex){
int leftValue = a * nums[leftIndex] * nums[leftIndex] + b * nums[leftIndex] + c;
int rightValue = a * nums[rightIndex] * nums[rightIndex] + b * nums[rightIndex] + c;
if(leftValue < rightValue){
result[resultIndex] = leftValue;
leftIndex++;
}
else{
result[resultIndex] = rightValue;
rightIndex--;
}
resultIndex++
}
#if a > 0
#result index is from length -1, and set the value from larger to smaller
}
}
```