You are given a binary string boxes of length n, where each character represents whether a box is empty (‘0’) or contains a ball (‘1’). Your task is to calculate, for each box, the minimum number of operations required to move all the balls to that particular box. An operation involves moving a ball from one box to an adjacent box.
You are given a sorted array nums of non-negative integers and an integer maximumBit. For each query, you need to find the optimal integer k (less than 2^maximumBit) such that the XOR of all elements in the current nums array and k is maximized. Remove the last element from nums after each query and return an array of results.
You are given an integer array nums and an integer k. In one operation, you can increment any element of the array by 1. Your task is to return the maximum possible frequency of any element after performing at most k operations.
You are given a 2D array logs where each entry represents the birth and death years of a person. You need to determine the earliest year that has the maximum population, where population is defined as the number of people alive in a given year.
You are given a binary string s and two integers minJump and maxJump. Initially, you are at index 0 of the string s, which is guaranteed to be ‘0’. You can move from index i to index j if: i + minJump <= j <= min(i + maxJump, s.length - 1), and s[j] == ‘0’. Return true if it’s possible to reach the last index of the string (s.length - 1), or false otherwise.
You are given an m x n matrix grid. A rhombus sum refers to the sum of the elements that form the border of a rhombus shape. The rhombus should be viewed as a square rotated 45 degrees, with each of its corners centered on a grid cell. Compute the biggest three distinct rhombus sums in the grid and return them in descending order. If there are fewer than three distinct sums, return all of them.