Wondering if there is a better solution

Правка en1, от Polar_, 2022-09-09 06:53:47

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)$$$?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Polar_ 2022-09-09 06:53:47 515 Initial revision (published)