Return sorted values after quadratic transform
Company: Two Sigma
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: nan
Interview Round: Technical Screen
## Problem
You are given a sorted integer array `nums` (non-decreasing order) and integers `a`, `b`, `c` that define a quadratic function:
\[
f(x) = ax^2 + bx + c
\]
Apply the function to every element in `nums`, producing an array `res[i] = f(nums[i])`. Return `res` in **sorted (non-decreasing) order**.
### Input
- `nums`: sorted array of integers
- `a`, `b`, `c`: integers
### Output
- A sorted array containing `f(x)` for each `x` in `nums`
### Constraints
- `1 <= len(nums) <= 2 * 10^5`
- `-10^4 <= nums[i], a, b, c <= 10^4`
### Example
- Input: `nums = [-4,-2,2,4], a = 1, b = 3, c = 5`
- Output: `[3,9,15,33]`
Quick Answer: This question evaluates understanding of mathematical transformations and array manipulation, specifically how applying a quadratic function affects the ordering of a sorted sequence.