Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Array Sorting in Ascending Order
00:00
5 left

Array Sorting in Ascending Order

EasyPython

Problem

Given an array, write a program to sort it in ascending order. Implement a function that accepts a list of integers and returns the values ordered from smallest to largest. The input may be empty and can contain duplicate or negative values.

Constraints

  • 0 <= nums.length <= 1000
  • -10^9 <= nums[i] <= 10^9
  • Return a list containing every input value exactly once

Function Signature

def sort_array(nums):
Interviewer

Your question is Array Sorting in Ascending Order. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.