Design an ATM machine that can handle deposits and withdrawals of five denominations: $20, $50, $100, $200, and $500. When withdrawing, the machine always tries to use the highest denominations available first. Implement methods to deposit money and withdraw specified amounts.
You are given a string number representing a positive integer and a character digit. Your task is to remove exactly one occurrence of digit from the string number such that the resulting number, when interpreted as an integer, is maximized. The test cases are guaranteed to have at least one occurrence of digit in the string.
You are given a 2D integer array tiles, where each element tiles[i] = [li, ri] represents that all integers from li to ri are painted white on a number line. Additionally, you are given an integer carpetLen, which represents the length of a carpet that can be placed anywhere on the number line. Your task is to return the maximum number of white tiles that can be covered by placing the carpet in a way that it maximizes the number of white tiles covered.
You have n bags, each capable of holding a certain number of rocks. You are given two arrays: capacity where capacity[i] is the maximum number of rocks that bag i can hold, and rocks where rocks[i] is the current number of rocks in bag i. You also have additionalRocks which represents the number of rocks you can distribute into the bags. Your goal is to determine the maximum number of bags that can be filled to their capacity after placing the additional rocks in any of the bags.
You are given a binary string s and a positive integer k. Your task is to find the length of the longest subsequence of s that represents a binary number less than or equal to k when converted to decimal.
You are given two integer arrays, nums1 and nums2, each of length n. You are also given two integers k1 and k2. Modify any element of nums1 or nums2 at most k1 or k2 times, respectively, to minimize the sum of squared differences between the two arrays.