Leetcode-Question-360: Sort Transformed Array

Original Link: (Premium)

https://leetcode.com/problems/sort-transformed-array/

Description:

Given a sorted array of integers nums and integer values a, b and c. Apply a quadratic function of the form f(x) = ax2 + bx + c to each element x in the array.

The returned array must be in sorted order.

Expected time complexity: O(n)

Example:

Solution:

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注