All Posts

Leetcode 1452: People Whose List of Favorite Companies Is Not a Subset of Another List

Given an array of lists where favoriteCompanies[i] represents the favorite companies of the i-th person, find the indices of people whose favorite company lists are not subsets of any other person’s list. Return these indices in increasing order.

Leetcode 1461: Check If a String Contains All Binary Codes of Size K

You are given a binary string s and an integer k. Your task is to determine if every possible binary code of length k appears as a substring within s. Return true if all such binary codes are present, otherwise return false.

Leetcode 1477: Find Two Non-overlapping Sub-arrays Each With Target Sum

You are given an array of integers arr and an integer target. You need to find two non-overlapping sub-arrays of arr each with a sum equal target. The goal is to minimize the sum of their lengths, and if no such sub-arrays exist, return -1.

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 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.