Squares of a Sorted Array
Problem Statement
Given an array of non-decreasing numbers, return a sorted, non-increasing array of each number's squared value in O(n) time. Consider the below:
//Given array
[-4,-1,0,3,10]
//Expected return value
[0,1,9,16,100]
Solution Explaine...
jimboslice.hashnode.dev2 min read