Sort an Integer Array in Ascending Order
Updated
Problem statement
Return the values of values in nondecreasing order. Duplicate and negative values are allowed.
Function
sortAscending(values: int[]) → int[]Examples
Example 1
values = [1,2,4,3]return = [1,2,3,4]The out-of-order final pair is corrected.
Example 2
values = [3,1,3,2]return = [1,2,3,3]Equal values are retained.
Constraints
0 <= values.length <= 100000-1000000000 <= values[i] <= 1000000000
More ZipRecruiter Online Assessment questions
- Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
- Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
- Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
- Minimum Changes to Draw a YOA · Seen Oct 2024
- Apply Binary State OperationsOA · Seen Sep 2024
- Simulate Orchard Rot SpreadOA · Seen Sep 2024
- Compare Odd- and Even-Index SumsOA · Seen Sep 2024
- Coordinate Removals with Column GravityOA · Seen Sep 2024
- Lexicographically Smallest End ReversalOA · Seen Sep 2024
- Recursively Expanded Shell Command CountsOA · Seen Sep 2024
Similar questions at other companies
- Build the Task HierarchyPendo · OA
- Count User Mentions in Chat MessagesRamp · OARamp interview questions
- Group Transactions by HourAffirm · ONSITE INTERVIEWAffirm interview questions
- Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Competition Winner and Runner-Up (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
- Merge Sorted ArrayDP World · ONSITE INTERVIEW
- Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
- Rank Football TeamsCapital One · OACapital One interview questions
- Maximum Apples That Fit in a BoxVirtu Financial · OAVirtu Financial interview questions
- Map and Accumulate Learning QueriesPalantir · ONSITE INTERVIEWPalantir interview questions