Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Sorting Lowest Number

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Sorting Lowest Number. Start with the requirements on the right.

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.

Problem

ABC Candidate Portal receives unsorted numeric scores that must be ordered before the minimum score is reported. Write a function that sorts the input array in ascending order and returns its lowest value.

Formal Specification

Implement lowest_after_sort(nums), where nums is a non-empty list of integers. Sort nums in place in ascending order, then return the first element, which is the lowest value. The function should return an integer and may modify the original list.

Constraints

  • 1 <= len(nums) <= 10^5
  • -10^9 <= nums[i] <= 10^9
  • Duplicate values are allowed.
  • The input list is non-empty.

Function Signature

def lowest_after_sort(nums):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output