567. Permutation in String
Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if one of s1‘s permutations is the substring of s2. Example 1: […]
Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if one of s1‘s permutations is the substring of s2. Example 1: […]
You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that
Given an array of positive integers nums, remove the smallest subarray (possibly empty) such that the sum of the remaining elements is divisible by p. It is not allowed
Given an array of integers arr, replace each element with its rank. The rank represents how large the element is. The
Given an array of integers arr of even length n and an integer k. We want to divide the array into exactly n / 2 pairs such
Design a stack that supports increment operations on its elements. Implement the CustomStack class: CustomStack(int maxSize) Initializes the object with maxSize which is the maximum
Design a data structure to store the strings’ count with the ability to return the strings with minimum and maximum
Design your implementation of the circular double-ended queue (deque). Implement the MyCircularDeque class: MyCircularDeque(int k) Initializes the deque with a maximum size of k.
You are implementing a program to use as your calendar. We can add a new event if adding the event
You are implementing a program to use as your calendar. We can add a new event if adding the event
You are given an array words of size n consisting of non-empty strings. We define the score of a string word as the number of strings words[i] such that word is a prefix of words[i]. For example, if words =
You are given two arrays with positive integers arr1 and arr2. A prefix of a positive integer is an integer formed by one or more of its