You are given an array of non-negative integers and an integer k. In one operation, you can choose any element from the array and increment it by 1. Your task is to determine the maximum product of the array elements after at most k operations. The result should be returned modulo 10^9 + 7.
You have a certain amount of money and want to buy pens and pencils. Given their costs, determine the number of distinct ways you can buy some combination of pens and pencils, including buying none.
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 2D integer array called grid of size m x n, where each cell contains a positive integer. A cornered path is a specific path in the grid with at most one directional change. The path must move either horizontally or vertically up to a single turn and then continue in the alternate direction. The product of a path is the product of all integers in that path. The task is to find the maximum number of trailing zeros in the product of a cornered path.
You are given a 2D integer array circles, where each element circles[i] = [xi, yi, ri] represents a circle with center at (xi, yi) and radius ri. The task is to find the number of lattice points that lie inside at least one of the given circles. A lattice point is defined as a point with integer coordinates, and points lying on the circumference of a circle are also considered inside.
You are given a 2D integer array rectangles, where each element rectangles[i] = [li, hi] represents a rectangle with a bottom-left corner at (0, 0), a length li, and a height hi. Additionally, you are provided a 2D integer array points, where each element points[j] = [xj, yj] represents a point on a 2D plane. The task is to determine the number of rectangles that contain each point. A rectangle contains a point if the point satisfies 0 <= xj <= li and 0 <= yj <= hi. Points on the edges of rectangles are also considered to be inside.