3455 Minimum Length Of String After Operations
Minimum Length of String After Operations You are given a string s. You can perform the following process on s any number of times: Choose an index i in the string such that there is **at least...
Minimum Length of String After Operations You are given a string s. You can perform the following process on s any number of times: Choose an index i in the string such that there is **at least...
Check if a Parentheses String Can Be Valid A parentheses string is a non-empty string consisting only of ‘(‘ and ‘)’. It is valid if any of the following conditions is true: It is (). It can be ...
Valid Parentheses Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is valid if: Open brackets must be clo...
Construct K Palindrome Strings Given a string s and an integer k, return true if you can use all the characters in *s to construct k palindrome strings or false otherwise*. Example 1: **Inp...
Word Subsets You are given two string arrays words1 and words2. A string b is a subset of string a if every letter in b occurs in a including multiplicity. For example, "wrr" is a subset of "wa...
Counting Words With a Given Prefix You are given an array of strings words and a string pref. Return the number of strings in *words that contain pref as a prefix*. A prefix of a string s is an...
Count Prefix and Suffix Pairs I You are given a 0-indexed string array words. Let’s define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2: isPrefixAndSuffix(str1, st...
String Matching in an Array Given an array of string words, return all strings in *words that is a substring of another word*. You can return the answer in any order. A substring is a contiguous...
Minimum Number of Operations to Move All Balls to Each Box You have n boxes. You are given a binary string boxes of length n, where boxes[i] is ‘0’ if the ith box is empty, and ‘1’ if it contains...
Shifting Letters II You are given a string s of lowercase English letters and a 2D integer array shifts where shifts[i] = [starti, endi, directioni]. For every i, shift the characters in s from t...