Tap here to switch tabs
Problem
Submissions

Problem: Sort Array By Absolute Value

Try to solve the Sort Array By Absolute Value problem.

Statement

Given an integer array nums, sort the array in non decreasing order based on the absolute value of each element.

Return the sorted array.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • −100≤-100 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sort Array By Absolute Value

Try to solve the Sort Array By Absolute Value problem.

Statement

Given an integer array nums, sort the array in non decreasing order based on the absolute value of each element.

Return the sorted array.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • −100≤-100 \leq nums[i] ≤100\leq 100