3451 String Compression Iii
String Compression III Given a string word, compress it using the following algorithm: Begin with an empty string comp. While word is **not** empty, use the following operation: Remove a maxim...
String Compression III Given a string word, compress it using the following algorithm: Begin with an empty string comp. While word is **not** empty, use the following operation: Remove a maxim...
Rotate String Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftmost character of s to the righ...
Circular Sentence A sentence is a list of words that are separated by a** single** space with no leading or trailing spaces. For example, "Hello World", "HELLO", "hello world hello world" are al...
Delete Characters to Make Fancy String A fancy string is a string where no three consecutive characters are equal. Given a string s, delete the minimum possible number of characters from s to ma...
Minimum Total Distance Traveled There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position of the ith robot. You are also given a 2D in...
Minimum Number of Removals to Make Mountain Array You may recall that an array arr is a mountain array if and only if: arr.length >= 3 There exists some index i (**0-indexed**) with 0 < i ...
Maximum Number of Moves in a Grid You are given a 0-indexed m x n matrix grid consisting of positive integers. You can start at any cell in the first column of the matrix, and traverse the grid ...
Longest Square Streak in an Array You are given an integer array nums. A subsequence of nums is called a square streak if: The length of the subsequence is at least 2, and **after** sorting the ...
Destroy Sequential Targets You are given a 0-indexed array nums consisting of positive integers, representing targets on a number line. You are also given an integer space. You have a machine wh...
Height of Binary Tree After Subtree Removal Queries You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of ...