You are given a string expression in the form ‘+’, where and represent positive integers. Your task is to add a pair of parentheses to the expression such that the resulting expression evaluates to the smallest possible value. The parentheses must be placed around the ‘+’ operator. If there are multiple valid solutions yielding the same result, any of them can be returned.
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.
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 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 an integer array nums and two integers k and p. Your task is to count the number of distinct subarrays where there are at most k elements divisible by p. A subarray is defined as a contiguous part of the array, and two subarrays are considered distinct if they differ in either length or at least one element.
Given a string s consisting of both uppercase and lowercase English letters, return the greatest letter that appears as both a lowercase and uppercase letter in the string. The returned letter should be in uppercase. If no such letter exists, return an empty string.