1092. Shortest Common Supersequence
Problem Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are...
Problem Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are...
Problem Design a food rating system that can do the following: Modify the rating of a food item listed in the system. Return...
Problem A sequence x₁, x₂, ..., xₙ is Fibonacci-like if: n >= 3 xᵢ + xᵢ₊₁ == xᵢ₊₂ for all i + 2 <= n Given a strictly...
Problem Design a text editor with a cursor that can do the following: Add text to where the cursor is. Delete text from wher...
Problem Given an array of integers arr, return the number of subarrays with an odd sum. Since the answer can be very large, r...
Problem You are given an integer array nums. The absolute sum of a subarray [numsₗ, numsₗ₊₁, ..., numsᵣ₋₁, numsᵣ] is abs(nums...
Problem You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history ...
Problem You are given an integer n representing the size of a 0-indexed memory array. All memory units are initially free. Yo...
Problem There is an undirected tree with n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 2D integer array ...
Problem There is a stream of n (idKey, value) pairs arriving in an arbitrary order, where idKey is an integer between 1 and n...
Problem Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinc...
Problem We run a preorder depth-first search (DFS) on the root of a binary tree. At each node in this traversal, we output D ...
Problem You are given a 0-indexed string array words. Two strings are similar if they consist of the same characters. For ex...
Problem Given a binary tree with the following rules: root.val == 0 For any treeNode: If treeNode.val has a value x and tre...
Problem You are given a 0-indexed binary string floor, which represents the colors of tiles on a floor: floor[i] = '0' denot...
Problem Given an array of strings nums containing n unique binary strings each of length n, return a binary string of length ...
Problem You are given a positive integer n. Let even denote the number of even indices in the binary representation of n with...
Problem You are given an 0-indexed integer array prices where prices[i] denotes the number of coins needed to purchase the (i...
Problem A happy string is a string that: consists only of letters of the set ['a', 'b', 'c']. s[i] != s[i + 1] for all value...
Problem You are given m arrays, where each array is sorted in ascending order. You can pick up two integers from two differen...
Problem You are given a 0-indexed string pattern of length n consisting of the characters 'I' meaning increasing and 'D' mean...
Problem Design a data structure to find the frequency of a given value in a given subarray. The frequency of a value in a sub...
Problem You have n tiles, where each tile has one letter tiles[i] printed on it. Return the number of possible non-empty sequ...
Problem Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more tha...
Problem Given an integer n, find a sequence that satisfies all of the following: The integer 1 occurs once in the sequence. ...
Problem Given an array arr, replace every element in that array with the greatest element among the elements to its right, an...
Problem Given a positive integer n, return the punishment number of n. The punishment number of n is defined as the sum of th...
Problem You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sid...
Problem Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream....
Problem In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in hi...
Problem You are working in a ball factory where you have n balls numbered from lowLimit up to highLimit inclusive (i.e., n ==...
Problem You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i...