All Posts

Leetcode 1827: Minimum Operations to Make the Array Increasing

You are given an integer array nums. In one operation, you can increment any element of the array by 1. The goal is to make the array strictly increasing, meaning that each element should be smaller than the next. Return the minimum number of operations required to achieve this.

Leetcode 1828: Queries on Number of Points Inside a Circle

You are given an array of points, each represented by its coordinates [xi, yi] on a 2D plane. You are also given an array of queries, where each query describes a circle defined by its center at (xj, yj) and its radius rj. For each query, your task is to compute how many points lie inside or on the border of the circle.

Leetcode 1829: Maximum XOR for Each Query

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.

Leetcode 1833: Maximum Ice Cream Bars

A boy wants to buy as many ice cream bars as possible, given their prices and the number of coins he has. Determine the maximum number of ice cream bars he can purchase without exceeding his budget.

Leetcode 1834: Single-Threaded CPU

You are given a list of tasks, where each task is represented by a pair of integers: [enqueueTime, processingTime]. The task can only be processed once its enqueueTime has passed. Your goal is to find the order in which tasks are processed by a single-threaded CPU that follows a specific processing strategy.

Leetcode 1838: Frequency of the Most Frequent Element

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.