All Posts

Leetcode 1481: Least Number of Unique Integers after K Removals

You are given an array of integers arr and an integer k. You need to remove exactly k elements from the array and find the minimum number of unique integers that remain in the array.

Leetcode 1482: Minimum Number of Days to Make m Bouquets

You are given an integer array bloomDay, an integer m, and an integer k. Your goal is to form m bouquets using exactly k adjacent flowers. Each flower blooms on a particular day. Determine the minimum number of days required to form m bouquets, or return -1 if it is impossible.

Leetcode 1487: Making File Names Unique

You are given an array ’names’ where each element represents a folder name. You will create folders sequentially at each minute. If a folder with the same name already exists, a suffix of the form ‘(k)’ is added, where k is the smallest positive integer such that the resulting name is unique.

Leetcode 1488: Avoid Flood in The City

Your country has an infinite number of lakes. Initially, all the lakes are dry, but on the nth day, the nth lake fills up with water. If it rains over a lake that is already full, there will be a flood. You need to avoid flooding by drying out lakes on some days when there is no rain.

Leetcode 1491: Average Salary Excluding the Minimum and Maximum Salary

You are given an array salary where each element represents the salary of an employee. The salaries are all unique. Return the average salary of the employees, excluding the minimum and maximum salary. Your answer should be correct to an absolute error of no more than 10^-5.

Leetcode 1493: Longest Subarray of 1's After Deleting One Element

Given a binary array nums, you should delete one element from it. After deleting one element, return the size of the longest non-empty subarray containing only 1’s in the resulting array. If no such subarray exists, return 0.