Hercy is saving money for his first car. He deposits money into his Leetcode bank account every day. On the first day (Monday), he deposits $1. For every subsequent day from Tuesday to Sunday, he deposits $1 more than the previous day. Every Monday, he increases his deposit by $1 compared to the previous Monday. Given a number n, representing the number of days Hercy saves money, return the total amount of money he has saved after the nth day.
You are given an encoded array of length n - 1, where each element encoded[i] represents the XOR of two consecutive elements in the original array arr, i.e., encoded[i] = arr[i] XOR arr[i + 1]. You are also given the first element of the original array arr[0]. Your task is to decode the array and return the original array arr.
You are given an array rectangles where each element rectangles[i] = [li, wi] represents a rectangle with length li and width wi. You can cut a square from the rectangle as long as the side of the square is less than or equal to both the length and width of the rectangle. Your task is to find the largest possible square that can be cut from any of the given rectangles, and then return how many rectangles can produce that largest square.
A biker is going on a road trip, where the trip consists of several points with different altitudes. The biker starts at point 0, which has an altitude of 0. You are given an array of integers gain, where each value represents the change in altitude between two consecutive points. Your task is to find the highest altitude the biker reaches during the trip.
You are given a time string in the format hh:mm, where some digits may be missing and represented by a question mark (?). Your task is to replace the ? with digits to form the latest valid time in the 24-hour format, which is between 00:00 and 23:59.
You are working in a ball factory with n balls numbered from lowLimit to highLimit (inclusive). You have an infinite number of boxes numbered from 1 to infinity. Your task is to place each ball into the box where the box number equals the sum of the digits of the ball’s number. For example, a ball numbered 321 will go into box 6 (since 3 + 2 + 1 = 6), and a ball numbered 10 will go into box 1 (since 1 + 0 = 1). The goal is to find the box with the most balls and return the number of balls in that box.