921. Minimum Add to Make Parentheses Valid
A parentheses string is valid if and only if: It is the empty string, It can be written as AB (A concatenated with B), […]
A parentheses string is valid if and only if: It is the empty string, It can be written as AB (A concatenated with B), […]
You are given a 0-indexed string s of even length n. The string consists of exactly n / 2 opening brackets ‘[‘ and n / 2 closing brackets ‘]’. A string is called balanced if and only
You are given a string s consisting only of uppercase English letters. You can apply some operations to this string where, in one operation,
You are given two strings sentence1 and sentence2, each representing a sentence composed of words. A sentence is a list of words that are separated by a single space
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.