I found this on leetcode someone posted the problem . I am wondering if there is a solution for followup .

Given a calculation class where you initialize values for $$$a,b,c$$$ and the following function $$$f(x) = ax^2 + bx + c$$$, and a list of numbers, apply this function to all values in the list.

```
class Calculation {
int a;
int b;
int c;
int[] calculate(int[] arr)
}
```

Followup: We want the output array to be sorted. Can we do better than $$$O(nlogn)$$$?