Mixed Sorting
Given a list of integers nums, sort the array such that:
Given a list of integers nums, sort the array such that:
You are given a list of integers nums of length n where all numbers in the list are from the interval \([1, n]$` and some elements appear twice while others ...
You are given two strings s and t of equal length only consisting of lowercase letters. Assuming that you can first rearrange s into any order, return the mi...
Implement a stack with the following methods:
You are given a list of integers nums. Return the minimum positive value we can append to the beginning of nums such that prefix sums of the resulting list c...
Given a list of integers nums, return the minimum cost of sorting the list in ascending or descending order. The cost is defined as the sum of absolute diffe...
Given a string s containing brackets ( and ), return the minimum number of brackets that can be inserted so that the brackets are balanced.
You are given a list of integers nums and an integer n. Given you must remove exactly n numbers, return the least number of unique integers after the removal...
You are given a list of integers nums and an integer k. Given that you must first remove a sublist of length k, return the minimum resulting max(nums) - min(...
Given two lists of integers a and b sorted in ascending order, merge them into one large sorted list.
Given two binary trees node0 and node1, return a merge of the two trees where each value is equal to the sum of the values of the corresponding nodes of the ...
Given a list of integers nums, split it into two lists of equal size where the absolute difference between each list’s median is as small as possible and ret...