Problem 977 · Easy

Squares of a Sorted Array

Square each value in a sorted array of signed numbers and return the squares in sorted order. The visual shows the largest square coming from either end of the array.

Open the interactive visualisation