2414 Move Pieces To Obtain A String
Move Pieces to Obtain a String You are given two strings start and target, both of length n. Each string consists only of the characters ‘L’, ‘R’, and ‘_’ where: The characters 'L' and 'R' repre...
Move Pieces to Obtain a String You are given two strings start and target, both of length n. Each string consists only of the characters ‘L’, ‘R’, and ‘_’ where: The characters 'L' and 'R' repre...
Make String a Subsequence Using Cyclic Increments You are given two 0-indexed strings str1 and str2. In an operation, you select a set of indices in str1, and for each index i in the set, increm...
Adding Spaces to a String You are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original string where spaces will be added. Each space should b...
Check If a Word Occurs As a Prefix of Any Word in a Sentence Given a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a prefix of any wor...
Check If N and Its Double Exist Given an array arr of integers, check if there exist two indices i and j such that : i != j 0 <= i, j < arr.length arr[i] == 2 * arr[j] Example 1: **...
Minimum Time to Visit a Cell In a Grid You are given a m x n matrix grid consisting of non-negative integers where grid[row][col] represents the minimum time required to be able to visit the cell...
Minimum Obstacle Removal to Reach Corner You are given a 0-indexed 2D integer array grid of size m x n. Each cell has one of two values: 0 represents an **empty** cell, 1 represents an **obstacl...
Shortest Distance After Road Addition Queries I You are given an integer n and a 2D integer array queries. There are n cities numbered from 0 to n - 1. Initially, there is a unidirectional road ...
Find Champion II There are n teams numbered from 0 to n - 1 in a tournament; each team is also a node in a DAG. You are given the integer n and a 0-indexed 2D integer array edges of length m rep...
Sliding Puzzle On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally adjacent number and swapping ...