function sortedSquaredArray(array) { const sArr = [...array]; const result = sArr.map((num)=> { return Math.pow(num, 2); }); return result.sort((a,b)=> a - b); }
O( n log n)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)