Category Archives: sorting

sorted-square

public class SortedSquare { public static int[] sortedSquare(int[] nums) { int[] result = new int[nums.length]; int writeIndex = nums.length – 1; int l = 0, r = nums.length – 1; while (l <= r) { if (nums[l] * nums[l] < … Continue reading

Posted in sorting | Comments Off on sorted-square