Tag: greedy algorithm
Given an integer n, you can swap any two digits at most once. Return the maximum value of the resulting number. Constraints 0 ≤ n < 2 ** 31 …
Given a list of integers nums, consider an operation where you pick any number e and remove every number in nums equal to e. Return the minimum number of …
Given a positive integer n, return whether n can be written as the sum of distinct positive factorial numbers. Example 1 Input n = 31 Output true Explanation Since …
You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes = : numberOfBoxesi is the number of boxes …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a list of integers prices representing prices of cars for sale, and a budget k, return the maximum number …