You are given a list of query strings and a pattern. A query string matches the pattern if you can insert lowercase English letters into the pattern such that it becomes the query string. Each character from the pattern must be placed in order without changing its relative positions, and you may not add any characters that are not in the pattern.
You are given an array of words, where each word consists of lowercase English letters. A wordA is considered a predecessor of wordB if you can insert exactly one letter anywhere in wordA without changing the order of the other characters to make it equal to wordB. A word chain is a sequence of words such that each word is a predecessor of the next one. Your task is to find the length of the longest word chain that can be formed from the given list of words.
You are given two strings, s1 and s2, which contain the same length, and a third string baseStr. Each pair of corresponding characters from s1 and s2 represent equivalent characters. Your task is to return the lexicographically smallest equivalent string for baseStr, where each character is replaced with its lexicographically smallest equivalent based on the equivalency information from s1 and s2.
You are given a string tiles containing uppercase English letters, where each letter represents a tile. You need to return the number of distinct non-empty sequences of letters that can be formed by selecting tiles from the string. A sequence can be formed by selecting tiles in any order and any number of times, but no tile can be used more than once in a sequence.
You are given a string s, and your task is to return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once. The subsequence must be in the same order as the original string, but the characters should not repeat.
A string consisting of only ‘(’ and ‘)’ characters is considered a valid parentheses string (VPS) if it satisfies the following conditions: it is empty, can be split into two valid VPS’s, or can be written in the form of ‘(A)’ where A is a VPS. You are given a VPS string seq. The task is to split it into two subsequences, A and B, such that both A and B are valid parentheses strings. The goal is to minimize the maximum nesting depth between A and B, and you need to return an array where each element is 0 if the character is part of A, and 1 if it’s part of B.