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 1456: Maximum Number of Vowels in a Substring of Given Length

You are given a string s consisting of lowercase English letters and an integer k. Your task is to find the maximum number of vowels in any substring of length k. Vowels in English are ‘a’, ’e’, ‘i’, ‘o’, and ‘u’.

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 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 1496: Path Crossing

You are given a string path where each character represents a movement direction (‘N’ for north, ‘S’ for south, ‘E’ for east, ‘W’ for west). Starting from the origin (0, 0), follow the path and check if you cross your own path at any point, meaning visiting a location more than once. Return true if the path crosses itself, and false otherwise.

Leetcode 1513: Number of Substrings With Only 1s

Given a binary string s, return the number of substrings that consist entirely of ‘1’s. Since the result can be large, return the answer modulo (10^9 + 7).