Practice · 4 problems
Sorting
0 of 4 solved on this device
- 152Merge Sorted ArrayYou are given two sorted arrays `nums1` (with m real values followed by n zeroes as spare room) and `nums2` (with n values). Merge nums2 into nums1 IN PLACE so nums1 ends up sorted.Easy
- 153Sort an ArrayGiven an array `nums`, sort it in ascending order WITHOUT using any built-in sort. The solution must run in O(n log n) time and use the smallest space possible.Medium
- 154Insertion Sort ListGiven the head of a singly linked list, sort it using INSERTION SORT and return the sorted head. Insertion sort repeatedly removes the next element and inserts it into its correct position in the sorted prefix.Medium
- 155Largest NumberGiven a list of non-negative integers `nums`, arrange them so they form the largest possible number, and return it as a string.Medium