LeetCodechevron_rightCategorieschevron_rightstring
text_fields

string

699 problems
Easy: 212Medium: 329Hard: 158

string is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

#TitleDifficulty
3

Longest Substring Without Repeating Characters

Find the length of the longest substring without repeating characters using a sliding window and hash map to track state…

Medium
5

Longest Palindromic Substring

Find the longest contiguous palindromic substring in a given string using dynamic programming and two-pointer expansion …

Medium
6

Zigzag Conversion

Convert a string into a zigzag pattern across multiple rows and read it line by line efficiently for string manipulation…

Medium
8

String to Integer (atoi)

Convert a string to a 32-bit signed integer by carefully parsing characters, handling signs, and ignoring invalid traili…

Medium
10

Regular Expression Matching

The Regular Expression Matching problem involves checking if a string matches a pattern using '.' and '*'.

Hard
12

Integer to Roman

Convert a given integer to its Roman numeral representation using hash table mapping and decimal place math operations e…

Medium
13

Roman to Integer

Convert a Roman numeral string into an integer using a hash table and mathematical principles to determine value order.

Easy
14

Longest Common Prefix

Find the longest common prefix in an array of strings, returning an empty string if none exists.

Easy
17

Letter Combinations of a Phone Number

Generate all letter combinations a digit string can represent using backtracking with pruning, leveraging hash table map…

Medium
20

Valid Parentheses

Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…

Easy
22

Generate Parentheses

Generate Parentheses requires generating all valid combinations of parentheses with given pairs using backtracking and s…

Medium
28

Find the Index of the First Occurrence in a String

Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …

Easy
30

Substring with Concatenation of All Words

Find all starting indices of substrings in a string that are concatenations of a given list of words.

Hard
32

Longest Valid Parentheses

Compute the length of the longest well-formed parentheses substring using state transition dynamic programming and stack…

Hard
38

Count and Say

Count and Say requires building the nth sequence term by iteratively applying a run-length encoding on strings of digits…

Medium
43

Multiply Strings

Multiply Strings requires simulating integer multiplication using only string operations without direct numeric conversi…

Medium
44

Wildcard Matching

Implement full wildcard pattern matching using '?' and '*' by applying state transition dynamic programming with careful…

Hard
49

Group Anagrams

Group the anagrams in a list of strings using efficient hash table-based methods, focusing on array scanning.

Medium
58

Length of Last Word

Determine the length of the last word in a string using a focused string-driven approach to handle spaces and trailing c…

Easy
65

Valid Number

Determine if a given string represents a valid number using precise string parsing and character validation rules.

Hard
67

Add Binary

Add Binary involves summing two binary strings and returning the result as a binary string using math and string manipul…

Easy
68

Text Justification

Text Justification requires packing words into lines to match a specified width, ensuring even distribution of spaces.

Hard
71

Simplify Path

Simplify a Unix-style path by transforming it into its canonical form using stack-based state management.

Medium
72

Edit Distance

Determine the minimum number of insertions, deletions, or replacements to transform one string into another using dynami…

Medium
76

Minimum Window Substring

Find the smallest substring of s containing all characters from t using a sliding window with running state updates for …

Hard
79

Word Search

Solve Word Search with backtracking by exploring adjacent cells to match a target word in a grid.

Medium
87

Scramble String

Scramble String is a dynamic programming problem where we determine if one string can be scrambled to form another using…

Hard
91

Decode Ways

Decode Ways is a dynamic programming problem focused on decoding a numeric string to letters using specific mappings.

Medium
93

Restore IP Addresses

Restore all valid IP addresses from a string using backtracking with pruning, avoiding invalid segments or leading zeros…

Medium
97

Interleaving String

The Interleaving String problem requires determining if a string can be formed by interleaving two others, utilizing dyn…

Medium
115

Distinct Subsequences

Compute the number of distinct subsequences of one string matching another using precise state transition dynamic progra…

Hard
125

Valid Palindrome

Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.

Easy
126

Word Ladder II

Find all shortest transformation sequences from beginWord to endWord using a dictionary, leveraging backtracking search …

Hard
127

Word Ladder

Find the shortest transformation sequence from a start word to an end word, with each word in the sequence differing by …

Hard
131

Palindrome Partitioning

Find all possible palindrome partitioning of a string using backtracking and dynamic programming.

Medium
132

Palindrome Partitioning II

Determine the minimum cuts required to partition a string into all palindromic substrings using dynamic programming tech…

Hard
139

Word Break

Determine if a string can be fully segmented into dictionary words using array scanning and hash-based lookups for effic…

Medium
140

Word Break II

Given a string and dictionary, return all possible sentences by adding spaces where each word is in the dictionary.

Hard
151

Reverse Words in a String

Reverse Words in a String requires reordering words using precise two-pointer scanning with careful space handling for e…

Medium
165

Compare Version Numbers

Compare two version numbers by checking their individual revisions, considering missing revisions as zero, using a two-p…

Medium
166

Fraction to Recurring Decimal

Convert a fraction into a decimal, handling repeating decimals with parentheses around the repeating part.

Medium
168

Excel Sheet Column Title

Convert a positive integer to its corresponding Excel column title using base-26 math and string manipulation efficientl…

Easy
171

Excel Sheet Column Number

This problem requires converting an Excel column title into its corresponding column number by applying a math and strin…

Easy
179

Largest Number

The problem asks to arrange integers to form the largest possible number, focusing on greedy algorithms and string handl…

Medium
187

Repeated DNA Sequences

Solve Repeated DNA Sequences by sliding a length-10 window and tracking seen patterns with a hash set or bitmask.

Medium
205

Isomorphic Strings

Determine if two strings are isomorphic by checking if one string can be transformed into the other using character repl…

Easy
208

Implement Trie (Prefix Tree)

This problem requires designing a Trie (Prefix Tree) to efficiently store and query strings using hash table concepts fo…

Medium
211

Design Add and Search Words Data Structure

Build a WordDictionary supporting dynamic word addition and search with wildcard matching efficiently using Trie and DFS…

Medium
212

Word Search II

Solve the Word Search II problem using backtracking with pruning to find all words on a board of characters.

Hard
214

Shortest Palindrome

The Shortest Palindrome problem asks to transform a string into a palindrome by adding characters at the beginning, with…

Hard
224

Basic Calculator

Implement a basic calculator to evaluate mathematical expressions, ensuring correct evaluation with stack-based manageme…

Hard
227

Basic Calculator II

Basic Calculator II evaluates a mathematical expression with operators and integers, handling basic arithmetic with prec…

Medium
241

Different Ways to Add Parentheses

Solve Different Ways to Add Parentheses by splitting on each operator and memoizing every subexpression result list.

Medium
242

Valid Anagram

Check if two strings are anagrams using hashing or sorting techniques.

Easy
257

Binary Tree Paths

Find all root-to-leaf paths in a binary tree using DFS and backtracking, constructing strings for each complete path eff…

Easy
273

Integer to English Words

Convert a given integer to its English words representation using mathematical logic and string manipulation.

Hard
282

Expression Add Operators

Expression Add Operators is solved with backtracking that builds multi-digit operands and tracks multiplication preceden…

Hard
290

Word Pattern

Solve Word Pattern by checking a one-to-one mapping between pattern letters and words using hash tables after splitting …

Easy
297

Serialize and Deserialize Binary Tree

This problem asks to serialize and deserialize a binary tree, requiring an efficient approach to handle traversal and st…

Hard
299

Bulls and Cows

Solve the Bulls and Cows problem using hash tables and string manipulation to track exact and misplaced digits.

Medium
301

Remove Invalid Parentheses

Remove the minimum number of invalid parentheses to generate all possible valid strings efficiently using backtracking a…

Hard
306

Additive Number

Additive Number is solved by trying the first two splits, then pruning aggressively while verifying each required sum in…

Medium
316

Remove Duplicate Letters

Remove duplicate letters from a string to produce the lexicographically smallest result using stack-based state manageme…

Medium
318

Maximum Product of Word Lengths

The problem requires finding the maximum product of lengths of two words from an array, where the words don't share comm…

Medium
331

Verify Preorder Serialization of a Binary Tree

Determine if a given string correctly represents a binary tree preorder traversal using state tracking and slot counting…

Medium
336

Palindrome Pairs

Find all pairs of words in a list that form palindromes when concatenated using efficient scanning and hash mapping.

Hard
344

Reverse String

Reverse a character array in-place using a two-pointer scanning technique, ensuring minimal memory and correct index swa…

Easy
345

Reverse Vowels of a String

Reverse Vowels of a String uses a two-pointer approach to reverse the vowels in a string while leaving the consonants in…

Easy
383

Ransom Note

Determine if a ransom note can be constructed from a magazine's letters using hash tables and string counting techniques…

Easy
385

Mini Parser

Deserialize a nested list string using stack-based state management, handling integers and nested lists with depth-first…

Medium
387

First Unique Character in a String

Find the index of the first non-repeating character in a string using efficient queue-driven state processing.

Easy
388

Longest Absolute File Path

Find the length of the longest absolute file path in a filesystem string using stack-based depth tracking efficiently.

Medium
389

Find the Difference

Find the Difference involves identifying the additional letter in one string compared to another, emphasizing hash table…

Easy
392

Is Subsequence

Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…

Easy
394

Decode String

Decode a nested encoded string using stack-based state management, handling repeated patterns efficiently with recursion…

Medium
395

Longest Substring with At Least K Repeating Characters

Find the length of the longest substring where every character appears at least k times using sliding window and divide-…

Medium
399

Evaluate Division

Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.

Medium
402

Remove K Digits

Remove K Digits requires selecting which digits to drop using a monotonic stack for the smallest possible integer result…

Medium
405

Convert a Number to Hexadecimal

Convert a 32-bit integer to its hexadecimal string using math operations and careful string manipulation techniques.

Easy
409

Longest Palindrome

Determine the length of the longest palindrome constructible from a given string using greedy counting and frequency tra…

Easy
412

Fizz Buzz

Generate a list from 1 to n replacing multiples of 3 with Fizz, 5 with Buzz, and both with FizzBuzz efficiently.

Easy
415

Add Strings

Given two non-negative integers as strings, sum them and return the result as a string without converting to integers di…

Easy
420

Strong Password Checker

The Strong Password Checker problem challenges you to optimize password strength while minimizing steps using greedy alg…

Hard
423

Reconstruct Original Digits from English

This problem asks you to reconstruct digits from an out-of-order English string using hash counting and mathematical ded…

Medium
424

Longest Repeating Character Replacement

Find the length of the longest substring after at most k replacements using a sliding window and character count trackin…

Medium
433

Minimum Genetic Mutation

Determine the minimum number of single-character gene mutations to reach the target gene using BFS and a hash table look…

Medium
434

Number of Segments in a String

Count the segments of non-space characters in a string by applying a string-driven approach to solve the problem.

Easy
438

Find All Anagrams in a String

Find all starting indices of p's anagrams in s using sliding window and hash table approach.

Medium
443

String Compression

Compress a character array in-place by converting consecutive repeated characters into counts using two-pointer scanning…

Medium
449

Serialize and Deserialize BST

Design an algorithm to serialize and deserialize a binary search tree with efficient traversal and state tracking.

Medium
451

Sort Characters By Frequency

Sort Characters By Frequency requires counting characters efficiently and rearranging a string in descending frequency o…

Medium
459

Repeated Substring Pattern

Check if a string can be constructed by repeating a substring using string matching techniques.

Easy
466

Count The Repetitions

This problem requires counting how many times a repeated string s2 fits as a subsequence within a repeated string s1 usi…

Hard
467

Unique Substrings in Wraparound String

Solve the 'Unique Substrings in Wraparound String' problem using dynamic programming with a state transition approach.

Medium
468

Validate IP Address

Determine whether a given string is a valid IPv4 or IPv6 address using a precise string-driven validation strategy.

Medium
472

Concatenated Words

Find concatenated words by using dynamic programming and depth-first search to identify valid words made of other words …

Hard
474

Ones and Zeroes

Solve the Ones and Zeroes problem using dynamic programming with state transition, focusing on array and string manipula…

Medium
481

Magical String

Count the number of '1's in the first n characters of a magical string using two-pointer scanning and invariant tracking…

Medium
482

License Key Formatting

Reformat a license key string by splitting into groups of size k, converting to uppercase, and handling dashes appropria…

Easy
488

Zuma Game

The Zuma Game involves clearing balls from the board using a limited hand, applying dynamic programming and state transi…

Hard
500

Keyboard Row

Identify all words from a list that can be typed using letters from only one row of a standard American keyboard.

Easy
504

Base 7

Convert any given integer to its base 7 string representation using efficient math and string manipulation techniques.

Easy
514

Freedom Trail

Determine the minimum rotations and button presses to spell a keyword on a circular dial using state transition dynamic …

Hard
516

Longest Palindromic Subsequence

Find the length of the longest palindromic subsequence in a string using precise state transition dynamic programming.

Medium
520

Detect Capital

Detect Capital asks you to determine if a word follows a correct capital usage pattern based on specific rules.

Easy
521

Longest Uncommon Subsequence I

Determine the length of the longest uncommon subsequence between two strings using a direct string comparison strategy.

Easy
522

Longest Uncommon Subsequence II

Find the longest string in an array that is not a subsequence of any other string, using array scanning and hash checks …

Medium
524

Longest Word in Dictionary through Deleting

Find the longest word in the dictionary that can be formed by deleting characters from a string, using two-pointer scann…

Medium
535

Encode and Decode TinyURL

Design a class that encodes and decodes URLs using a URL shortening approach based on hash tables and strings.

Medium
537

Complex Number Multiplication

This problem requires multiplying two complex numbers, given in string form, and returning the result in the same format…

Medium
539

Minimum Time Difference

Calculate the smallest time difference between clock points using array manipulation and mathematical conversions effici…

Medium
541

Reverse String II

Reverse String II requires reversing segments of a string using two-pointer scanning while tracking invariants carefully…

Easy
551

Student Attendance Record I

Determine if a student's attendance record qualifies for an award based on specific criteria for absences and lateness.

Easy
556

Next Greater Element III

Find the next greater integer using the same digits as a given number with precise two-pointer scanning and invariant tr…

Medium
557

Reverse Words in a String III

Reverse Words in a String III involves reversing each word in a sentence using the two-pointer technique.

Easy
564

Find the Closest Palindrome

Identify the nearest palindrome to a given integer string, handling ties and large numbers efficiently using math and st…

Hard
567

Permutation in String

Check if a string contains a permutation of another string using two-pointer scanning and hash table techniques.

Medium
583

Delete Operation for Two Strings

Find the minimum number of steps to make two strings equal by deleting characters, using dynamic programming.

Medium
591

Tag Validator

The Tag Validator problem involves validating a code snippet by parsing through tags using a stack-based state managemen…

Hard
592

Fraction Addition and Subtraction

Solve fraction addition and subtraction by handling expressions, calculating results, and simplifying fractions to irred…

Medium
599

Minimum Index Sum of Two Lists

Find the common strings between two lists with the smallest index sum in this easy problem involving array scanning and …

Easy
606

Construct String from Binary Tree

Given a binary tree, construct a string representation based on preorder traversal while adhering to specific formatting…

Medium
609

Find Duplicate File in System

Find and return duplicate files in the file system, grouping them by their paths and contents using an array scanning ap…

Medium
639

Decode Ways II

Decode Ways II is a challenging dynamic programming problem that involves decoding messages with digits and wildcard cha…

Hard
640

Solve the Equation

Solve the equation for the variable 'x' and determine its value or state if there is no solution or infinite solutions.

Medium
647

Palindromic Substrings

Count all palindromic substrings in a given string using state transition dynamic programming for efficient evaluation.

Medium
648

Replace Words

Replace words in a sentence using the shortest root from a dictionary, applying efficient array scanning and hash lookup…

Medium
649

Dota2 Senate

The Dota2 Senate problem involves simulating voting rounds between Radiant and Dire senators until one party wins, using…

Medium
657

Robot Return to Origin

Judge whether a robot returns to the origin after a sequence of moves using string manipulation and simulation.

Easy
664

Strange Printer

Calculate the minimum turns a strange printer needs to print any string using state transition dynamic programming effic…

Hard
676

Implement Magic Dictionary

Design a Magic Dictionary to allow searching with one-character modifications, using Hash Table and String techniques.

Medium
677

Map Sum Pairs

Design and implement a data structure that supports efficient insertion and sum queries based on string prefixes.

Medium
678

Valid Parenthesis String

Solve the Valid Parenthesis String problem by leveraging state transition dynamic programming to handle parentheses and …

Medium
680

Valid Palindrome II

Check if a string can become a palindrome by deleting at most one character using two-pointer scanning and invariant tra…

Easy
686

Repeated String Match

Find the minimum number of repetitions of string a to make string b a substring of the repeated string a.

Medium
691

Stickers to Spell Word

Determine the minimum number of stickers needed to spell a target word using array scanning and hash lookups for efficie…

Hard
692

Top K Frequent Words

Solve Top K Frequent Words by counting each word, then ordering ties alphabetically so frequency wins before lexicograph…

Medium
696

Count Binary Substrings

Count Binary Substrings solves for the number of valid substrings with equal 0's and 1's, grouped consecutively in a bin…

Easy
709

To Lower Case

The "To Lower Case" problem asks you to convert all uppercase letters in a string to lowercase.

Easy
712

Minimum ASCII Delete Sum for Two Strings

This problem focuses on minimizing the ASCII delete sum for two strings by using dynamic programming to find the lowest …

Medium
720

Longest Word in Dictionary

Find the longest word in a dictionary that can be built one character at a time from other words in the dictionary.

Medium
721

Accounts Merge

Merge accounts by connecting emails and returning each user's sorted email list using array scanning and hash lookup eff…

Medium
722

Remove Comments

Remove comments from a given C++ program source array, handling line and block comments.

Medium
726

Number of Atoms

Compute the exact count of each atom in a chemical formula using stack-based state management and hashing techniques eff…

Hard
730

Count Different Palindromic Subsequences

Count Different Palindromic Subsequences leverages dynamic programming to count non-empty palindromic subsequences in a …

Hard
736

Parse Lisp Expression

Parse Lisp expressions using stack-based state management to evaluate variables and operations.

Hard
745

Prefix and Suffix Search

Design a dictionary to search words by both prefix and suffix using a Trie structure and hash lookups.

Hard
748

Shortest Completing Word

Find the shortest word that completes the license plate by matching all required letters, considering frequency and case…

Easy
752

Open the Lock

Solve the Open the Lock problem using array scanning plus hash lookup to efficiently find the shortest unlock sequence.

Medium
761

Special Binary String

Solve the Special Binary String problem using string manipulation and recursion, optimizing lexicographical order.

Hard
763

Partition Labels

Partition a string into maximal parts so that each letter appears in only one segment, using two-pointer scanning.

Medium
767

Reorganize String

Reorganize a string so that no two adjacent characters are the same, if possible, using a greedy approach.

Medium
770

Basic Calculator IV

Simplify mathematical expressions using stack-based state management, handling variables, operators, and polynomial term…

Hard
771

Jewels and Stones

Given two strings, determine how many of the stones you have are also jewels, considering case sensitivity.

Easy
777

Swap Adjacent in LR String

Transform one string into another by swapping adjacent 'L' and 'R' characters in a sequence of moves.

Medium
784

Letter Case Permutation

Letter Case Permutation involves generating all possible strings by changing the case of each letter in a given string.

Medium
791

Custom Sort String

Sort the string `s` according to a custom order defined by string `order`.

Medium
792

Number of Matching Subsequences

Given a string s and a list of words, count how many words are subsequences of s using efficient array scanning and hash…

Medium
796

Rotate String

Determine if one string can be rotated into another by repeatedly shifting characters, leveraging string matching techni…

Easy
804

Unique Morse Code Words

Determine how many unique Morse code transformations can be generated from a list of words using a hash table and array …

Easy
806

Number of Lines To Write String

Calculate how many lines are needed to write a string given individual letter widths, constrained to 100 pixels per line…

Easy
809

Expressive Words

Expressive Words challenges you to determine if a word can be transformed into a given string by extending groups of rep…

Medium
811

Subdomain Visit Count

The Subdomain Visit Count problem requires counting the visits to all subdomains of a given domain from a list of count-…

Medium
816

Ambiguous Coordinates

Find all valid 2D coordinate possibilities for an ambiguous input string using backtracking and pruning techniques.

Medium
819

Most Common Word

Find the most frequent non-banned word in a paragraph, excluding punctuation, using an efficient array scan and hash tab…

Easy
820

Short Encoding of Words

Find the minimum length of a reference string encoding an array of words using array scanning and hash lookup efficientl…

Medium
821

Shortest Distance to a Character

Compute the minimum distance from each character in a string to a target character using efficient scanning techniques.

Easy
824

Goat Latin

Convert a sentence to Goat Latin by transforming each word based on vowel rules and incremental suffixes efficiently.

Easy
828

Count Unique Characters of All Substrings of a Given String

Calculate the sum of unique characters in all substrings of a string using state transition dynamic programming.

Hard
830

Positions of Large Groups

Identify and return intervals of consecutive, large character groups in a string of lowercase letters.

Easy
831

Masking Personal Information

This problem requires masking sensitive parts of emails and phone numbers using a precise string-driven strategy efficie…

Medium
833

Find And Replace in String

This problem challenges you to perform multiple string replacements at specific indices using a pattern involving array …

Medium
838

Push Dominoes

In the "Push Dominoes" problem, you simulate the falling dominoes based on their initial states and determine their fina…

Medium
839

Similar String Groups

Determine the number of connected groups of similar strings by swapping at most two letters using array scanning and has…

Hard
842

Split Array into Fibonacci Sequence

This problem challenges you to split a string into a Fibonacci-like sequence using backtracking and pruning.

Medium
843

Guess the Word

Master the Guess the Word problem by applying array manipulation, match-counting math, and strategic interactive guessin…

Hard
844

Backspace String Compare

Compare two strings after processing backspaces using efficient two-pointer scanning and careful invariant tracking to e…

Easy
848

Shifting Letters

Given a string and a shift array, shift the first i+1 letters of the string as specified in the array.

Medium
854

K-Similar Strings

K-Similar Strings involves finding the minimal number of swaps to transform one string into another through character sw…

Hard
856

Score of Parentheses

Calculate the score of a balanced parentheses string using stack-based state management for an optimal solution.

Medium
859

Buddy Strings

Determine if two strings can become equal by swapping exactly two letters using a hash table for character tracking.

Easy
880

Decoded String at Index

Decode the string and find the k-th letter efficiently using stack-based state management in this problem.

Medium
884

Uncommon Words from Two Sentences

Find uncommon words from two sentences by counting word frequencies using hash tables.

Easy
890

Find and Replace Pattern

Identify all words matching a given pattern by checking consistent letter mappings using hash tables and array scanning …

Medium
893

Groups of Special-Equivalent Strings

Determine the number of special-equivalent string groups using character swaps at even or odd indices efficiently.

Medium
899

Orderly Queue

Given a string and integer k, rearrange characters to achieve the lexicographically smallest string using limited rotati…

Hard
902

Numbers At Most N Given Digit Set

The 'Numbers At Most N Given Digit Set' problem requires calculating how many numbers can be formed using a given digit …

Hard
903

Valid Permutations for DI Sequence

The problem asks to find the number of valid permutations for a given DI sequence string using dynamic programming and s…

Hard
906

Super Palindromes

Count all super-palindromes in a given numeric range, where each is a palindrome and square of a palindrome.

Hard
916

Word Subsets

Word Subsets is solved by merging words2 into one max-frequency requirement, then scanning words1 against that fixed let…

Medium
917

Reverse Only Letters

Reverse the characters of a string while skipping non-letter characters using a two-pointer technique.

Easy
921

Minimum Add to Make Parentheses Valid

Compute the minimum insertions needed to make a parentheses string valid using efficient stack-based state tracking tech…

Medium
925

Long Pressed Name

Check if a typed string could result from long pressing characters while typing a given name using a two-pointer scan.

Easy
926

Flip String to Monotone Increasing

Minimize the number of flips needed to make a binary string monotone increasing using dynamic programming.

Medium
929

Unique Email Addresses

Identify the count of unique email addresses by normalizing local names and using hash-based lookups efficiently.

Easy
936

Stamping The Sequence

Solve Stamping The Sequence with stack-based state management to convert string s to target using stamp efficiently.

Hard
937

Reorder Data in Log Files

Reorder Data in Log Files requires sorting letter-logs lexicographically while keeping digit-logs in original order for …

Medium
940

Distinct Subsequences II

Find the number of distinct non-empty subsequences of a string using dynamic programming and state transitions.

Hard
942

DI String Match

Reconstruct a permutation from a DI string using two-pointer scanning, carefully tracking the increasing and decreasing …

Easy
943

Find the Shortest Superstring

This problem requires constructing the shortest string containing all input words using state transition dynamic program…

Hard
944

Delete Columns to Make Sorted

The 'Delete Columns to Make Sorted' problem asks to remove unsorted columns from a string array, ensuring all columns ar…

Easy
949

Largest Time for Given Digits

Given four digits, determine the latest valid 24-hour time possible using each digit exactly once with backtracking.

Medium
953

Verifying an Alien Dictionary

Verify if a sequence of words is sorted according to an alien language's custom alphabet order using array scanning and …

Easy
955

Delete Columns to Make Sorted II

Solve the "Delete Columns to Make Sorted II" problem by applying greedy choices and invariant validation to string array…

Medium
960

Delete Columns to Make Sorted III

The problem requires minimizing deletions to ensure all strings are lexicographically sorted. Use dynamic programming fo…

Hard
966

Vowel Spellchecker

Implement a spellchecker that matches queries to a wordlist using exact, case-insensitive, and vowel-error rules efficie…

Medium
972

Equal Rational Numbers

Given two rational numbers as strings with possible repeating decimals, determine if they represent the same number.

Hard
981

Time Based Key-Value Store

Implement a time-based key-value store that retrieves the latest value at a given timestamp using efficient binary searc…

Medium
984

String Without AAA or BBB

Solve the problem of constructing a string without consecutive 'AAA' or 'BBB' by applying a greedy approach with invaria…

Medium
988

Smallest String Starting From Leaf

Determine the lexicographically smallest string from a leaf to root using binary-tree traversal and careful state tracki…

Medium
990

Satisfiability of Equality Equations

Determine if it's possible to assign values to variables such that all equations are satisfied based on equality and ine…

Medium
1002

Find Common Characters

Return an array of common characters from all strings in the given list of words, including duplicates.

Easy
1003

Check If Word Is Valid After Substitutions

Determine if a string can be built from repeated 'abc' insertions using stack-based state management, verifying sequence…

Medium
1016

Binary String With Substrings Representing 1 To N

Check if binary string contains all integers from 1 to n as substrings, leveraging sliding window and bit manipulation t…

Medium
1021

Remove Outermost Parentheses

Remove Outermost Parentheses simplifies a valid parentheses string by removing the outermost layers of parentheses in ea…

Easy
1023

Camelcase Matching

Camelcase Matching is a medium difficulty problem where you match queries to a given pattern by inserting lowercase lett…

Medium
1028

Recover a Tree From Preorder Traversal

Recover a binary tree from its preorder traversal string by tracking node depth and reconstructing child relationships e…

Hard
1032

Stream of Characters

Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…

Hard
1041

Robot Bounded In Circle

Determine if a robot following a repeated instruction sequence stays within a bounded circle using math and string simul…

Medium
1044

Longest Duplicate Substring

Find the longest duplicated substring in a string using binary search, sliding window, and rolling hash techniques.

Hard
1047

Remove All Adjacent Duplicates In String

Solve Remove All Adjacent Duplicates In String by simulating deletions with a stack that collapses matching neighbors im…

Easy
1048

Longest String Chain

Find the longest word chain by scanning arrays and using hash lookups to efficiently track predecessor-successor sequenc…

Medium
1061

Lexicographically Smallest Equivalent String

Determine the lexicographically smallest string by modeling character equivalences with union find efficiently.

Medium
1071

Greatest Common Divisor of Strings

Find the greatest common divisor string between two strings based on the math and string patterns.

Easy
1078

Occurrences After Bigram

Extract the third word in every adjacent triple of words matching a given bigram pattern from a text.

Easy
1079

Letter Tile Possibilities

Compute all unique non-empty sequences from given letter tiles using backtracking search with pruning efficiently.

Medium
1081

Smallest Subsequence of Distinct Characters

The Smallest Subsequence of Distinct Characters problem asks you to find the lexicographically smallest subsequence of a…

Medium
1092

Shortest Common Supersequence

Compute the shortest string containing both given strings as subsequences using state transition dynamic programming eff…

Hard
1096

Brace Expansion II

Solve Brace Expansion II efficiently by using stack-based state management to generate all unique combinations of nested…

Hard
1106

Parsing A Boolean Expression

Solve the "Parsing A Boolean Expression" problem by evaluating boolean expressions using stack-based state management, r…

Hard
1108

Defanging an IP Address

Transform an IPv4 address by replacing each period with '[.]', focusing on a string-driven, direct manipulation approach…

Easy
1111

Maximum Nesting Depth of Two Valid Parentheses Strings

This problem challenges you to compute the maximum nesting depth of two valid parentheses strings using stack-based stat…

Medium
1138

Alphabet Board Path

Find the path to type a target string on an alphabet board using directional moves and the 'hash table plus string' patt…

Medium
1143

Longest Common Subsequence

Find the length of the longest common subsequence between two strings using state transition dynamic programming for eff…

Medium
1147

Longest Chunked Palindrome Decomposition

Solve the "Longest Chunked Palindrome Decomposition" problem by using dynamic programming and string manipulation techni…

Hard
1154

Day of the Year

Calculate the day number of the year based on a given Gregorian calendar date in the format YYYY-MM-DD.

Easy
1156

Swap For Longest Repeated Character Substring

Find the maximum length of a repeated character substring after swapping two characters using a sliding window approach …

Medium
1160

Find Words That Can Be Formed by Characters

Compute the total length of words that can be fully constructed from given characters using array scanning and hash mapp…

Easy
1163

Last Substring in Lexicographical Order

Identify the lexicographically last substring in a string using two-pointer scanning with invariant tracking efficiently…

Hard
1169

Invalid Transactions

Detect invalid transactions by scanning arrays and cross-checking with hash tables for time, amount, and city conflicts …

Medium
1170

Compare Strings by Frequency of the Smallest Character

Compare Strings by Frequency of the Smallest Character requires counting minimal character frequencies in words and quer…

Medium
1177

Can Make Palindrome from Substring

Given a string and queries, determine if a substring can be rearranged and modified to form a palindrome.

Medium
1178

Number of Valid Words for Each Puzzle

Solve the "Number of Valid Words for Each Puzzle" problem with array scanning and hash lookup to efficiently count valid…

Hard
1189

Maximum Number of Balloons

Find the maximum number of times the word 'balloon' can be formed from characters of the given string.

Easy
1190

Reverse Substrings Between Each Pair of Parentheses

Reverse all substrings within matched parentheses using a stack-based approach for efficient state tracking and reversal…

Medium
1202

Smallest String With Swaps

Find the lexicographically smallest string by swapping characters in given pairs of indices.

Medium
1208

Get Equal Substrings Within Budget

Optimize substring transformations using a binary search approach to maximize the change within a budget.

Medium
1209

Remove All Adjacent Duplicates in String II

Remove all adjacent duplicates in the string using stack-based state management with a given threshold k.

Medium
1221

Split a String in Balanced Strings

Split a string into the maximum number of balanced substrings where each substring has an equal number of 'L' and 'R'.

Easy
1233

Remove Sub-Folders from the Filesystem

Remove sub-folders in a filesystem by filtering out folders nested inside other folders.

Medium
1234

Replace the Substring for Balanced String

Determine the minimum substring length to replace in order to balance a string of Q, W, E, and R characters efficiently.

Medium
1239

Maximum Length of a Concatenated String with Unique Characters

Find the maximum length of a concatenated string from an array with all unique characters using backtracking search with…

Medium
1247

Minimum Swaps to Make Strings Equal

This problem requires determining the minimum number of swaps to make two strings equal by swapping characters between t…

Medium
1249

Minimum Remove to Make Valid Parentheses

Given a string with parentheses and letters, remove the fewest parentheses to produce any valid balanced string efficien…

Medium
1255

Maximum Score Words Formed by Letters

Calculate the highest total score by selecting words from a list using available letters, respecting individual letter s…

Hard
1268

Search Suggestions System

Design a search suggestion system that provides the top three lexicographically smallest products matching a search word…

Medium
1278

Palindrome Partitioning III

Find the minimal character changes to split a string into k palindromes using precise dynamic programming state transiti…

Hard
1286

Iterator for Combination

Implement an iterator that generates all combinations of a given length using efficient backtracking with pruning.

Medium
1297

Maximum Number of Occurrences of a Substring

Find the maximum number of occurrences of any valid substring in a given string with specific constraints on letter coun…

Medium
1307

Verbal Arithmetic Puzzle

Check if a verbal arithmetic equation can be solved using a valid digit-letter mapping.

Hard
1309

Decrypt String from Alphabet to Integer Mapping

Decrypt a string using alphabet-to-integer mapping, considering the presence of '#' as a special delimiter.

Easy
1312

Minimum Insertion Steps to Make a String Palindrome

The problem asks to find the minimum number of insertions to convert a string into a palindrome using dynamic programmin…

Hard
1316

Distinct Echo Substrings

Count the distinct non-empty substrings of a given string that can be formed as the concatenation of a string with itsel…

Hard
1320

Minimum Distance to Type a Word Using Two Fingers

Calculate the minimum total distance to type a word using two fingers on a keyboard, applying dynamic programming.

Hard
1324

Print Words Vertically

Transform a string into vertical columns by arranging each word character in array positions while trimming trailing spa…

Medium
1328

Break a Palindrome

Given a palindrome, change exactly one character to make it non-palindromic and lexicographically smallest using a greed…

Medium
1332

Remove Palindromic Subsequences

This problem challenges you to remove palindromic subsequences from a string with a minimum number of steps using two-po…

Easy
1347

Minimum Number of Steps to Make Two Strings Anagram

Calculate the minimum steps to transform one string into an anagram of another using character replacements efficiently.

Medium
1358

Number of Substrings Containing All Three Characters

Count all substrings containing at least one of each character a, b, and c using a sliding window approach efficiently.

Medium
1360

Number of Days Between Two Dates

Calculate the exact number of days between two dates using string parsing and arithmetic logic with consistent accuracy.

Easy
1366

Rank Teams by Votes

Rank Teams by Votes requires counting position-based votes and resolving ties with array scanning and hash lookup techni…

Medium
1370

Increasing Decreasing String

Reorder the string based on a specific algorithm using hash tables and string manipulation.

Easy
1371

Find the Longest Substring Containing Vowels in Even Counts

Find the longest substring with even counts of vowels using bitmasking and hash tables.

Medium
1374

Generate a String With Characters That Have Odd Counts

Generate a string of n characters where each character appears an odd number of times, using a string-driven approach.

Easy
1392

Longest Happy Prefix

Find the longest non-empty prefix of a string that also appears as its suffix, optimizing with rolling hash techniques.

Hard
1396

Design Underground System

Design an underground system to calculate travel times between stations using hash tables for efficient lookups and aver…

Medium
1397

Find All Good Strings

Find all good strings between two given strings without including a specified evil substring using dynamic programming.

Hard
1400

Construct K Palindrome Strings

Determine if a string's characters can be rearranged to form exactly k non-empty palindrome strings using greedy validat…

Medium
1404

Number of Steps to Reduce a Number in Binary Representation to One

Determine the number of steps to reduce a binary representation of a number to 1 by following specific rules.

Medium
1405

Longest Happy String

Solve the "Longest Happy String" problem using a greedy approach with validation of invariants for constructing the long…

Medium
1408

String Matching in an Array

Identify all strings in an array that appear as substrings of other strings, focusing on array and string matching patte…

Easy
1410

HTML Entity Parser

Transform a string containing HTML entities into their character equivalents using a hash table for efficient parsing.

Medium
1415

The k-th Lexicographical String of All Happy Strings of Length n

Given n and k, find the k-th lexicographical happy string of length n using backtracking search with pruning.

Medium
1416

Restore The Array

Calculate the number of arrays that can be restored from a string of digits where each number is within [1, k].

Hard
1417

Reformat The String

Reformat The String involves rearranging alphanumeric characters in a string so that no adjacent characters have the sam…

Easy
1418

Display Table of Food Orders in a Restaurant

Generate a restaurant display table from orders by counting each food item per table using array scanning and hash looku…

Medium
1419

Minimum Number of Frogs Croaking

Determine the minimum number of frogs required to sequentially produce all croaks in a mixed frog croak string efficient…

Medium
1422

Maximum Score After Splitting a String

Find the optimal split point in a binary string to maximize zeros on the left and ones on the right efficiently.

Easy
1433

Check If a String Can Break Another String

This problem checks whether one string can break another using permutations and a greedy approach for comparison.

Medium
1436

Destination City

Find the destination city from a list of paths where each path connects two cities. The city with no outgoing path is th…

Easy
1446

Consecutive Characters

Find the power of a string by determining the length of its longest substring with a unique character.

Easy
1447

Simplified Fractions

Generate simplified fractions between 0 and 1 with denominators up to a given integer n.

Medium
1451

Rearrange Words in a Sentence

Rearrange words in a sentence by their length, maintaining original order for words of equal size for consistent output.

Medium
1452

People Whose List of Favorite Companies Is Not a Subset of Another List

Identify people whose favorite companies lists are unique and not subsets of any other person's list using efficient arr…

Medium
1455

Check If a Word Occurs As a Prefix of Any Word in a Sentence

Determine the first word in a sentence where a given searchWord is a prefix using two-pointer scanning with string match…

Easy
1456

Maximum Number of Vowels in a Substring of Given Length

Find the maximum number of vowels in a substring of a given length in a string using a sliding window approach.

Medium
1461

Check If a String Contains All Binary Codes of Size K

Determine if every possible binary string of length k exists as a substring within a given binary string s efficiently u…

Medium
1487

Making File Names Unique

This problem requires creating unique folder names by appending suffixes to duplicate names using an array scanning and …

Medium
1496

Path Crossing

Check if a path crosses itself on a 2D plane using a hash table to track visited points during traversal.

Easy
1505

Minimum Possible Integer After at Most K Adjacent Swaps On Digits

Reorder digits using at most k adjacent swaps to produce the smallest possible integer, leveraging greedy selection effi…

Hard
1507

Reformat Date

Reformat Date requires transforming a date string from human-readable form to YYYY-MM-DD using a string-driven strategy …

Easy
1513

Number of Substrings With Only 1s

Calculate the number of contiguous substrings containing only 1s in a binary string using a math and string approach eff…

Medium
1520

Maximum Number of Non-Overlapping Substrings

Find the maximum number of non-overlapping substrings in a given string, ensuring no two substrings intersect unless one…

Hard
1525

Number of Good Ways to Split a String

Count all valid splits of a string where left and right substrings have equal distinct characters, using efficient state…

Medium
1528

Shuffle String

Reorder characters in a string using a given indices array to reconstruct the intended output efficiently and correctly.

Easy
1529

Minimum Suffix Flips

Find the minimum number of operations to convert a binary string to a target string using bit flips.

Medium
1531

String Compression II

Solve String Compression II with dynamic programming that tracks deletions, run boundaries, and digit-length jumps in co…

Hard
1540

Can Convert String in K Moves

Determine if string s can be transformed into t within k moves using character shifts and hash table counting efficientl…

Medium
1541

Minimum Insertions to Balance a Parentheses String

Compute the minimum insertions to transform a parentheses string into a balanced string using efficient stack tracking.

Medium
1542

Find Longest Awesome Substring

Find the maximum-length awesome substring in a numeric string using hash table and bit manipulation for palindrome poten…

Hard
1544

Make The String Great

This problem requires removing adjacent characters that cancel each other out, leveraging stack-based state management.

Easy
1545

Find Kth Bit in Nth Binary String

Determine the k-th bit in the n-th binary string using a recursive construction that inverts and reverses previous strin…

Medium
1556

Thousand Separator

Convert a given integer into a string with dots as thousand separators using a precise string-driven strategy.

Easy
1573

Number of Ways to Split a String

Count the number of ways to split a binary string into three non-empty parts with equal numbers of '1's.

Medium
1576

Replace All ?'s to Avoid Consecutive Repeating Characters

Solve LeetCode 1576 by scanning left to right and replacing each ? with a letter different from its neighbors.

Easy
1578

Minimum Time to Make Rope Colorful

Minimize the time Bob needs to remove balloons to make a rope colorful using dynamic programming with state transitions.

Medium
1585

Check If String Is Transformable With Substring Sort Operations

This problem requires checking if string 's' can be transformed into string 't' using substring sort operations.

Hard
1592

Rearrange Spaces Between Words

Rearrange spaces between words by distributing them evenly, placing any leftover spaces at the end to match original tex…

Easy
1593

Split a String Into the Max Number of Unique Substrings

Maximize unique substrings in a string using backtracking with pruning and hash tables to track substrings.

Medium
1598

Crawler Log Folder

Simulate folder navigation based on a list of operations to determine the current folder depth.

Easy
1604

Alert Using Same Key-Card Three or More Times in a One Hour Period

Solve LeetCode 1604 by grouping swipe times per employee, sorting each list, and scanning for any three within 60 minute…

Medium
1614

Maximum Nesting Depth of the Parentheses

Find the maximum nesting depth of parentheses in a valid string using stack-based state management.

Easy
1616

Split Two Strings to Make Palindrome

Determine if splitting two equal-length strings at a common index can form a palindrome using two-pointer scanning techn…

Medium
1624

Largest Substring Between Two Equal Characters

Find the longest substring between two equal characters using a hash table for optimized performance.

Easy
1625

Lexicographically Smallest String After Applying Operations

Optimize a string through rotations and additions to get the lexicographically smallest possible result using string man…

Medium
1629

Slowest Key

Determine which key had the longest press duration in a sequence using array indices and string mapping, resolving ties …

Easy
1638

Count Substrings That Differ by One Character

Count all substrings from s that differ by exactly one character from some substring in t using precise substring compar…

Medium
1639

Number of Ways to Form a Target String Given a Dictionary

Calculate the number of ways to form a target string using words of equal length via state transition dynamic programmin…

Hard
1647

Minimum Deletions to Make Character Frequencies Unique

Determine the minimum deletions needed to ensure all character frequencies in a string are unique using a greedy approac…

Medium
1653

Minimum Deletions to Make String Balanced

Determine the minimum number of deletions to transform a string of 'a' and 'b' into a balanced order using DP.

Medium
1657

Determine if Two Strings Are Close

Check if two strings can transform into each other using letter swaps and frequency reorganizations, leveraging hash tab…

Medium
1662

Check If Two String Arrays are Equivalent

Determine if two string arrays form identical strings by concatenating elements in order, handling subtle array-length m…

Easy
1663

Smallest String With A Given Numeric Value

Find the lexicographically smallest string of length n with a given numeric value k using a greedy approach.

Medium
1668

Maximum Repeating Substring

Find the maximum number of times a given word repeats consecutively in a string using state transition dynamic programmi…

Easy
1678

Goal Parser Interpretation

Interpret the Goal Parser's output by analyzing a command string containing 'G', '()', and '(al)' patterns.

Easy
1684

Count the Number of Consistent Strings

Count the number of strings fully composed of allowed characters using array scanning and hash lookup for efficiency.

Easy
1689

Partitioning Into Minimum Number Of Deci-Binary Numbers

This problem asks to find the minimum number of deci-binary numbers needed to sum to a given number represented as a str…

Medium
1694

Reformat Phone Number

Reformat a phone number by removing spaces and dashes, grouping digits into blocks of 3 or 2, and joining them with dash…

Easy
1702

Maximum Binary String After Change

The problem asks to maximize a binary string using specific operations to get the highest possible value.

Medium
1704

Determine if String Halves Are Alike

Check if two halves of a string contain the same number of vowels using a character counting approach efficiently.

Easy
1717

Maximum Score From Removing Substrings

Compute the highest score by greedily removing specific substrings using a stack to track state transitions efficiently.

Medium
1736

Latest Time by Replacing Hidden Digits

Determine the latest valid time by replacing hidden digits using a greedy choice and invariant validation strategy effic…

Easy
1737

Change Minimum Characters to Satisfy One of Three Conditions

This problem asks for the minimum operations to change two strings so that one of three conditions is met.

Medium
1745

Palindrome Partitioning IV

The Palindrome Partitioning IV problem asks you to determine if a string can be split into three palindromic substrings.

Hard
1750

Minimum Length of String After Deleting Similar Ends

Minimize string length by deleting similar characters from both ends repeatedly using a two-pointer technique.

Medium
1754

Largest Merge Of Two Strings

Construct the lexicographically largest merge from two strings using a two-pointer greedy scanning approach efficiently.

Medium
1758

Minimum Changes To Make Alternating Binary String

Find the minimum number of changes required to convert a string into an alternating binary string.

Easy
1759

Count Number of Homogenous Substrings

This problem requires counting all homogenous substrings in a given string and returning the result modulo 10^9 + 7.

Medium
1763

Longest Nice Substring

Find the longest nice substring in a given string using the sliding window technique with running state updates.

Easy
1768

Merge Strings Alternately

Merge two strings alternately, starting with the first string, and append extra characters when one string is longer.

Easy
1769

Minimum Number of Operations to Move All Balls to Each Box

Solve the problem of finding the minimum operations to move balls to each box using an efficient approach with arrays an…

Medium
1771

Maximize Palindrome Length From Subsequences

Maximize Palindrome Length From Subsequences explores dynamic programming to construct the longest palindrome from two s…

Hard
1773

Count Items Matching a Rule

Count Items Matching a Rule is an easy problem that tests array and string manipulation with conditions based on specifi…

Easy
1781

Sum of Beauty of All Substrings

Calculate the total beauty of all substrings by counting character frequencies and computing frequency differences effic…

Medium
1784

Check if Binary String Has at Most One Segment of Ones

Check if a binary string contains at most one contiguous segment of ones.

Easy
1790

Check if One String Swap Can Make Strings Equal

Check if one string swap can make two equal strings using hash table and string counting methods.

Easy
1796

Second Largest Digit in a String

Given a string with alphanumeric characters, find the second largest digit, or return -1 if it doesn’t exist.

Easy
1805

Number of Different Integers in a String

Count all unique integers in a string by replacing letters and handling leading zeros correctly with a hash table approa…

Easy
1807

Evaluate the Bracket Pairs of a String

Quickly evaluate a string with bracketed keys using array scanning and hash table lookups for efficient replacements.

Medium
1812

Determine Color of a Chessboard Square

Determine whether a given chessboard square is white or black by converting coordinates using a math plus string approac…

Easy
1813

Sentence Similarity III

Sentence Similarity III asks if one sentence can be transformed into another by inserting a sentence inside it.

Medium
1816

Truncate Sentence

Truncate a sentence to contain only the first k words by converting it into an array of words.

Easy
1830

Minimum Number of Operations to Make String Sorted

Calculate the minimum operations to sort a string using combinatorial math and string manipulation techniques efficientl…

Hard
1832

Check if the Sentence Is Pangram

Determine if a given lowercase string contains every English letter using efficient hash table tracking techniques.

Easy
1839

Longest Substring Of All Vowels in Order

Find the longest substring of all vowels in order within a given string of vowels using sliding window technique.

Medium
1844

Replace All Digits with Characters

Transform a string by replacing digits at odd indices using the preceding character with a shift operation for accurate …

Easy
1849

Splitting a String Into Descending Consecutive Values

Check if a string of digits can be split into descending consecutive values where the difference between them is 1.

Medium
1850

Minimum Adjacent Swaps to Reach the Kth Smallest Number

Find the minimum number of adjacent swaps to reach the kth smallest wonderful integer from a given number string.

Medium
1859

Sorting the Sentence

Reconstruct a shuffled sentence by sorting words using their embedded indices to restore the original sentence order eff…

Easy
1864

Minimum Number of Swaps to Make the Binary String Alternating

This problem requires finding the minimum number of swaps to make a binary string alternating or determine if it's impos…

Medium
1869

Longer Contiguous Segments of Ones than Zeros

Determine if the longest segment of 1s in a binary string is strictly longer than the longest segment of 0s.

Easy
1871

Jump Game VII

The problem asks to determine if we can reach the last index of a binary string, with a set range of jumps between indic…

Medium
1876

Substrings of Size Three with Distinct Characters

Count all substrings of length three in a string where each character is unique using sliding window techniques efficien…

Easy
1880

Check if Word Equals Summation of Two Words

Check if the sum of two word values equals a target word's value by converting letters to their numeric representations.

Easy
1881

Maximum Value after Insertion

Solve Maximum Value after Insertion by greedily placing x at the first digit that makes the resulting signed number larg…

Medium
1888

Minimum Number of Flips to Make the Binary String Alternating

Find the minimum number of flips to make a binary string alternate, using state transition dynamic programming.

Medium
1896

Minimum Cost to Change the Final Value of Expression

Determine the minimum operations to change a boolean expression's result using state transition dynamic programming effi…

Hard
1897

Redistribute Characters to Make All Strings Equal

Determine if you can redistribute characters among strings so that all strings become identical using a counting approac…

Easy
1898

Maximum Number of Removable Characters

Use binary search and a subsequence check to find the largest removable prefix that still keeps p inside s.

Medium
1903

Largest Odd Number in String

Find the largest odd number in a string using a greedy approach with careful digit inspection and invariant checks.

Easy
1904

The Number of Full Rounds You Have Played

Solve this math plus string problem to calculate the number of full rounds played in a chess tournament between login an…

Medium
1910

Remove All Occurrences of a Substring

Remove all occurrences of a specified substring from a string using efficient stack-based state management.

Medium
1915

Number of Wonderful Substrings

Count the number of wonderful non-empty substrings of a given string based on frequency conditions of characters.

Medium
1927

Sum Game

Determine if Alice can force a win in the Sum Game by strategically replacing '?' using a greedy and invariant approach.

Medium
1930

Unique Length-3 Palindromic Subsequences

Count all unique length-3 palindromic subsequences in a string efficiently using hash tables and character positions.

Medium
1935

Maximum Number of Words You Can Type

Determine how many words can be typed on a malfunctioning keyboard with some broken keys.

Easy
1941

Check if All Characters Have Equal Number of Occurrences

Check if a string has characters with equal occurrences using hash tables and string manipulation techniques.

Easy
1945

Sum of Digits of String After Convert

Convert a lowercase string into digits and repeatedly sum them k times using a direct string plus simulation approach.

Easy
1946

Largest Number After Mutating Substring

Find the largest integer by mutating a substring of a number using a mapping array for each digit.

Medium
1948

Delete Duplicate Folders in System

Solve Delete Duplicate Folders in System by building a trie, serializing child subtrees, and deleting repeated non-empty…

Hard
1957

Delete Characters to Make Fancy String

This problem asks to remove the minimum number of characters from a string to ensure no three consecutive characters are…

Easy
1960

Maximum Product of the Length of Two Palindromic Substrings

Find the maximum product of lengths of two non-overlapping odd-length palindromic substrings using string and rolling ha…

Hard
1961

Check If String Is a Prefix of Array

Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.

Easy
1963

Minimum Number of Swaps to Make the String Balanced

Determine the minimum swaps to balance a bracket string using two-pointer scanning with invariant tracking efficiently.

Medium
1967

Number of Strings That Appear as Substrings in Word

Count how many strings in an array appear as substrings within a given word by checking each pattern individually.

Easy
1974

Minimum Time to Type Word Using Special Typewriter

Compute the minimum typing time by greedily taking the shorter circular move between consecutive letters, then adding on…

Easy
1977

Number of Ways to Separate Numbers

Calculate the number of valid non-decreasing integer sequences from a string using state transition dynamic programming …

Hard
1980

Find Unique Binary String

Find a binary string of length n not in the input array using array scanning and hash lookup efficiently.

Medium
1985

Find the Kth Largest Integer in the Array

This problem asks to find the kth largest integer in an array of string numbers, highlighting sorting and string-based c…

Medium
1987

Number of Unique Good Subsequences

Find the number of unique good subsequences of a binary string using dynamic programming and modular arithmetic.

Hard
2000

Reverse Prefix of Word

Reverse the prefix of a string starting from index 0 to the first occurrence of a given character.

Easy
2002

Maximum Product of the Length of Two Palindromic Subsequences

Find two disjoint palindromic subsequences in a string to maximize the product of their lengths efficiently using dynami…

Medium
2011

Final Value of Variable After Performing Operations

Compute the final value of X by simulating each string operation in the array sequentially with careful tracking.

Easy
2014

Longest Subsequence Repeated k Times

Find the longest subsequence repeated k times in a string using backtracking search with pruning.

Hard
2019

The Score of Students Solving Math Expression

Calculate student scores for a single-digit math expression using state transition dynamic programming to track all vali…

Hard
2023

Number of Pairs of Strings With Concatenation Equal to Target

Count all unique index pairs in a string array whose concatenation exactly matches the given target string using efficie…

Medium
2024

Maximize the Confusion of an Exam

Maximize the Confusion of an Exam requires adjusting at most k answers to create the longest consecutive true or false s…

Medium
2027

Minimum Moves to Convert String

Minimize moves to convert a string of 'X' and 'O' to all 'O' by converting three consecutive characters to 'O'.

Easy
2030

Smallest K-Length Subsequence With Occurrences of a Letter

Find the lexicographically smallest subsequence of length k with at least repetition occurrences of a given letter using…

Hard
2038

Remove Colored Pieces if Both Neighbors are the Same Color

Alice and Bob play a game removing colored pieces; Alice wins if she makes the last valid move.

Medium
2042

Check if Numbers Are Ascending in a Sentence

Check if the numbers in a sentence are strictly increasing from left to right using string tokenization.

Easy
2047

Number of Valid Words in a Sentence

Count all valid words in a sentence by analyzing each token with precise string-driven validation rules efficiently.

Easy
2053

Kth Distinct String in an Array

Find the kth distinct string in an array by identifying strings that appear only once, using efficient array scanning an…

Easy
2055

Plates Between Candles

Determine the number of plates between candles in a given substring using binary search and prefix sum techniques.

Medium
2056

Number of Valid Move Combinations On Chessboard

Given a set of pieces on a chessboard, calculate the number of valid move combinations without overlap using backtrackin…

Hard
2060

Check if an Original String Exists Given Two Encoded Strings

Determine if there exists an original string that could produce both encoded inputs using state transition dynamic progr…

Hard
2062

Count Vowel Substrings of a String

Count the number of vowel substrings that include all five vowels in a string.

Easy
2063

Vowels of All Substrings

Compute the total number of vowels in all substrings of a given string using efficient state transition dynamic programm…

Medium
2068

Check Whether Two Strings are Almost Equivalent

Solve Check Whether Two Strings are Almost Equivalent by counting letters and rejecting any character whose frequency ga…

Easy
2075

Decode the Slanted Ciphertext

Decode the Slanted Ciphertext problem requires decoding a slanted cipher using string manipulation and simulation based …

Medium
2085

Count Common Words With One Occurrence

Learn how to efficiently count strings appearing exactly once in both arrays using array scanning and hash lookup patter…

Easy
2086

Minimum Number of Food Buckets to Feed the Hamsters

Find the minimum number of food buckets required to feed all hamsters, using dynamic programming and greedy techniques.

Medium
2096

Step-By-Step Directions From a Binary Tree Node to Another

Find the shortest path between two nodes in a binary tree and output the directions as a string of 'L', 'R', and 'U'.

Medium
2103

Rings and Rods

Count how many rods have all three colors using a hash table to track colors per rod efficiently in strings.

Easy
2108

Find First Palindromic String in the Array

Return the first palindromic string from an array of words or an empty string if none exists.

Easy
2109

Adding Spaces to a String

Learn to efficiently insert spaces in a string using two-pointer scanning with invariant tracking in linear time.

Medium
2114

Maximum Number of Words Found in Sentences

Find the maximum number of words in a single sentence from an array of sentences using array and string processing techn…

Easy
2115

Find All Possible Recipes from Given Supplies

Determine all recipes you can prepare given initial supplies and ingredient dependencies, leveraging array scanning and …

Medium
2116

Check if a Parentheses String Can Be Valid

Determine if a parentheses string can be transformed into a valid sequence considering locked positions using stack logi…

Medium
2120

Execution of All Suffix Instructions Staying in a Grid

Simulate robot moves from every instruction index on an n x n grid, counting valid steps without leaving boundaries.

Medium
2124

Check if All A's Appears Before All B's

Determine if all 'a's in a string appear before any 'b's using a direct string-driven check strategy for clarity and cor…

Easy
2125

Number of Laser Beams in a Bank

Calculate total laser beams in a bank floor plan using array counting and math logic between security devices on differe…

Medium
2129

Capitalize the Title

Capitalize the Title requires transforming each word based on length, applying uppercase and lowercase rules precisely p…

Easy
2131

Longest Palindrome by Concatenating Two Letter Words

Find the maximum-length palindrome by combining two-letter words using array scanning and hash table lookups efficiently…

Medium
2135

Count Words Obtained After Adding a Letter

Given startWords and targetWords, check how many targetWords can be formed by adding one letter and rearranging letters …

Medium
2138

Divide a String Into Groups of Size k

Divide a string into equal groups of size k, using a fill character to complete the last group if needed.

Easy
2147

Number of Ways to Divide a Long Corridor

Calculate the number of ways to split a corridor into sections with exactly two seats using dynamic programming efficien…

Hard
2156

Find Substring With Given Hash Value

Locate the first substring of length k whose rolling hash matches the given hashValue using a sliding window approach.

Hard
2157

Groups of Strings

Group words into connected sets using operations on characters with string and bit manipulation techniques.

Hard
2166

Design Bitset

Master the Design Bitset problem by efficiently managing bit flips, counts, and indexed updates with array and hash look…

Medium
2167

Minimum Time to Remove All Cars Containing Illegal Goods

Determine the minimum time to remove all cars with illegal goods using state transition dynamic programming efficiently.

Hard
2182

Construct String With Repeat Limit

Construct a lexicographically largest string from a given string with no letter appearing more than a repeatLimit times …

Medium
2185

Counting Words With a Given Prefix

Count how many words in a list start with a given prefix.

Easy
2186

Minimum Number of Steps to Make Two Strings Anagram II

Compute the fewest character insertions needed to turn two strings into anagrams using hash table frequency counts effic…

Medium
2193

Minimum Number of Moves to Make Palindrome

The problem challenges you to find the minimum number of adjacent swaps to make a string a palindrome.

Hard
2194

Cells in a Range on an Excel Sheet

This problem requires extracting a range of cells from an Excel-like sheet based on a string input and returning them in…

Easy
2207

Maximize Number of Subsequences in a String

Maximize the number of subsequences by optimally adding a character to a given string to match a specified pattern.

Medium
2209

Minimum White Tiles After Covering With Carpets

Find the minimum number of white tiles visible after optimally placing carpets using state transition dynamic programmin…

Hard
2211

Count Collisions on a Road

Count Collisions on a Road is a problem where you calculate the number of car collisions based on their movements in a s…

Medium
2213

Longest Substring of One Repeating Character

Solve Longest Substring of One Repeating Character by maintaining mergeable run information under character updates afte…

Hard
2222

Number of Ways to Select Buildings

Solve Number of Ways to Select Buildings by counting alternating 3-building patterns with state transitions over the bin…

Medium
2223

Sum of Scores of Built Strings

Calculate the sum of scores of built strings by analyzing longest common prefixes with suffixes in a string using effici…

Hard
2224

Minimum Number of Operations to Convert Time

The problem asks to find the minimum number of operations to convert one time string to another using specific time incr…

Easy
2227

Encrypt and Decrypt Strings

The 'Encrypt and Decrypt Strings' problem involves creating a data structure that can encrypt and decrypt strings using …

Hard
2232

Minimize Result by Adding Parentheses to Expression

Enumerate every valid parenthesis placement around the plus sign and choose the expression with the smallest evaluated p…

Medium
2243

Calculate Digit Sum of a String

Learn how to repeatedly sum digit groups in a string until its length is at most k using string simulation techniques.

Easy
2246

Longest Path With Different Adjacent Characters

Find the longest path in a tree where adjacent nodes have different characters using graph DFS and topological reasoning…

Hard
2255

Count Prefixes of a Given String

Count Prefixes of a Given String is a problem that involves finding the number of string prefixes in an array that match…

Easy
2259

Remove Digit From Number to Maximize Result

Determine the largest possible number by removing one specific digit using a greedy approach and string iteration.

Easy
2262

Total Appeal of A String

Calculate the total appeal of all substrings by counting distinct characters efficiently using state transition DP and h…

Hard
2264

Largest 3-Same-Digit Number in String

Find the largest 3-same-digit number within a string of digits using a string-driven solution approach.

Easy
2266

Count Number of Texts

Calculate the total number of possible original texts from a pressed key sequence using state transition dynamic program…

Medium
2269

Find the K-Beauty of a Number

Calculate the k-beauty of a number by counting substrings of length k that divide the original number evenly using a sli…

Easy
2273

Find Resultant Array After Removing Anagrams

This problem requires removing adjacent anagrams from a list of words using an array scanning and hash lookup approach.

Easy
2278

Percentage of Letter in String

Calculate the percentage of a specific letter in a string using a direct string-driven counting approach, rounding down …

Easy
2283

Check if Number Has Equal Digit Count and Digit Value

Determine if a number's digits correspond to their counts in the string representation.

Easy
2284

Sender With Largest Word Count

Find the sender with the largest total word count by scanning messages and tallying counts using a hash table efficientl…

Medium
2287

Rearrange Characters to Make Target String

Calculate the maximum copies of a target string from letters in s using frequency counting and hash tables efficiently.

Easy
2288

Apply Discount to Prices

Apply Discount to Prices involves updating a sentence by applying a percentage discount to price words, with precise for…

Medium
2296

Design a Text Editor

Design a text editor that supports text manipulation and cursor navigation operations efficiently with linked-list-based…

Hard
2299

Strong Password Checker II

Check if a given password meets all strength requirements, including length, character types, and no adjacent repeated c…

Easy
2301

Match Substring After Replacement

Determine if a target substring can appear in a string after optional character replacements using given mappings effici…

Hard
2306

Naming a Company

The "Naming a Company" problem requires determining the number of valid distinct company names from a list of name ideas…

Hard
2309

Greatest English Letter in Upper and Lower Case

Find the greatest English letter that exists in both lowercase and uppercase in a string using a hash table approach.

Easy
2311

Longest Binary Subsequence Less Than or Equal to K

Find the longest subsequence in a binary string that forms a number less than or equal to a given integer k.

Medium
2315

Count Asterisks

The 'Count Asterisks' problem asks you to count '*' excluding those between pairs of '|' in a string.

Easy
2325

Decode the Message

Decode the Message is an easy problem involving hash table mapping for string decoding based on a cipher key.

Easy
2337

Move Pieces to Obtain a String

Determine if the pieces in start can be moved to form target using two-pointer scanning and strict left-right movement r…

Medium
2343

Query Kth Smallest Trimmed Number

Solve the Query Kth Smallest Trimmed Number problem by efficiently trimming and sorting strings in an array to answer qu…

Medium
2351

First Letter to Appear Twice

Find the first letter that repeats in a string using hash table tracking and early detection for efficiency.

Easy
2353

Design a Food Rating System

Design a food rating system that tracks and updates ratings of foods, finding the highest rated items by cuisine.

Medium
2370

Longest Ideal Subsequence

The Longest Ideal Subsequence problem involves finding the longest subsequence where each character has a difference of …

Medium
2375

Construct Smallest Number From DI String

Construct the lexicographically smallest string that fits the increasing and decreasing conditions of a given pattern.

Medium
2379

Minimum Recolors to Get K Consecutive Black Blocks

Given a string of blocks, determine the minimum number of recolors needed to get k consecutive black blocks.

Easy
2380

Time Needed to Rearrange a Binary String

Calculate the exact seconds required to convert all 01 pairs into 10 in a binary string using state transitions.

Medium
2381

Shifting Letters II

Shift letters in a string using a sequence of range-based forward or backward operations efficiently with prefix sums.

Medium
2384

Largest Palindromic Number

Form the largest palindromic number from a string of digits while maintaining a valid palindrome structure.

Medium
2390

Removing Stars From a String

Remove all stars from a string by simulating the removal process using a stack to manage characters and stars efficientl…

Medium
2391

Minimum Amount of Time to Collect Garbage

This problem asks you to find the minimum amount of time needed to collect all garbage in a city, focusing on array and …

Medium
2399

Check Distances Between Same Letters

Verify if each pair of identical letters in a string has the exact number of letters between them as specified in a dist…

Easy
2405

Optimal Partition of String

Given a string s, partition it into substrings with unique characters and return the minimum number of substrings.

Medium
2409

Count Days Spent Together

Count the total number of days Alice and Bob are in Rome together, given their arrival and departure dates.

Easy
2414

Length of the Longest Alphabetical Continuous Substring

Find the length of the longest continuous alphabetical substring from a given string of lowercase letters.

Medium
2416

Sum of Prefix Scores of Strings

The 'Sum of Prefix Scores of Strings' problem involves calculating prefix scores for strings based on their occurrences …

Hard
2418

Sort the People

Sort the People requires pairing names with heights and sorting them in descending height order efficiently using arrays…

Easy
2423

Remove Letter To Equalize Frequency

Determine if removing a single letter from a string can make all remaining letters have identical frequency efficiently.

Easy
2430

Maximum Deletions on a String

Find the maximum number of deletions on a string using state transition dynamic programming and rolling hash techniques …

Hard
2434

Using a Robot to Print the Lexicographically Smallest String

Solve the problem of using a robot to print the lexicographically smallest string with stack-based state management.

Medium
2437

Number of Valid Clock Times

Calculate how many valid digital clock times can be formed by replacing unknown digits in a string format hh:mm.

Easy
2446

Determine if Two Events Have Conflict

Compare two same-day time intervals and check whether their inclusive endpoints overlap after converting HH:MM strings i…

Easy
2451

Odd String Difference

Identify the one string in an array whose consecutive letter differences deviate from all others using array scanning pl…

Easy
2452

Words Within Two Edits of Dictionary

Identify all words in queries that can match dictionary entries with at most two character changes efficiently using arr…

Medium
2456

Most Popular Video Creator

Identify the most popular video creator by summing views and selecting their top-viewed video with array and hash patter…

Medium
2468

Split Message Based on Limit

Split Message Based on Limit requires dividing a string into parts with length constraints using a calculated suffix pat…

Hard
2472

Maximum Number of Non-overlapping Palindrome Substrings

Find the maximum number of non-overlapping palindromic substrings of at least length k in a string using dynamic program…

Hard
2478

Number of Beautiful Partitions

The problem involves finding the number of beautiful partitions in a string with dynamic programming and state transitio…

Hard
2483

Minimum Penalty for a Shop

Determine the earliest closing hour of a shop to minimize penalty using a string of customer visits and prefix sums.

Medium
2484

Count Palindromic Subsequences

Count the number of palindromic subsequences of length 5 in a given string of digits.

Hard
2486

Append Characters to String to Make Subsequence

Determine the minimum characters to append to s so t becomes a subsequence using efficient two-pointer scanning techniqu…

Medium
2490

Circular Sentence

Determine if a sentence is circular by verifying each word's last character matches the next word's first character effi…

Easy
2496

Maximum Value of a String in an Array

The problem requires finding the maximum value of alphanumeric strings in an array based on length or numeric value.

Easy
2506

Count Pairs Of Similar Strings

Count similar string pairs by converting each word into a character-set signature and counting matching signatures effic…

Easy
2512

Reward Top K Students

Calculate top K student scores by scanning reports and using hash tables for positive and negative word lookups efficien…

Medium
2514

Count Anagrams

Learn to count distinct anagrams for a multi-word string using hash tables, math, and combinatorics efficiently.

Hard
2515

Shortest Distance to Target String in a Circular Array

Find the shortest distance to a target string in a circular array with either left or right movement options.

Easy
2516

Take K of Each Character From Left and Right

Find the minimum number of minutes needed to take at least k of each character from both ends of a string.

Medium
2522

Partition String Into Substrings With Values at Most K

Determine the minimum number of substrings from a numeric string such that each substring value does not exceed k using …

Medium
2531

Make Number of Distinct Characters Equal

Determine if a single swap can equalize distinct character counts between two strings using hash tables for tracking fre…

Medium
2546

Apply Bitwise Operations to Make Strings Equal

Determine if a binary string s can be transformed into target using repeated bitwise operations on paired indices effici…

Medium
2559

Count Vowel Strings in Ranges

Count the number of strings that start and end with a vowel in given ranges within an array of words.

Medium
2564

Substring XOR Queries

Solve the Substring XOR Queries problem using array scanning and hash lookup to efficiently handle multiple queries on b…

Medium
2565

Subsequence With the Minimum Score

Find the minimum score of a string by removing characters from t while maintaining subsequence validity with s.

Hard
2573

Find the String with LCP

Determine the lexicographically smallest string matching a given LCP matrix using state transition dynamic programming.

Hard
2575

Find the Divisibility Array of a String

Calculate the divisibility array for a string by checking if prefixes are divisible by a given number.

Medium
2586

Count the Number of Vowel Strings in Range

Count the Number of Vowel Strings in Range asks to count vowel strings in a subarray of a given word list.

Easy
2606

Find the Substring With Maximum Cost

Find the Substring With Maximum Cost requires calculating substring values using a hash lookup for character costs, with…

Medium
2609

Find the Longest Balanced Substring of a Binary String

Find the longest balanced substring of a binary string where zeroes precede ones and counts of each are equal.

Easy
2645

Minimum Additions to Make Valid String

Determine the minimum insertions required to transform a given string into repeated concatenations of 'abc' using dynami…

Medium
2663

Lexicographically Smallest Beautiful String

Find the lexicographically smallest beautiful string larger than the given string using greedy choice and invariant vali…

Hard
2678

Number of Senior Citizens

Determine how many passengers are over 60 years old based on their compressed details in an array of strings.

Easy
2696

Minimum String Length After Removing Substrings

Determine the smallest string length after repeatedly removing AB or CD substrings using stack-based simulation techniqu…

Easy
2697

Lexicographically Smallest Palindrome

Given a string, make it a palindrome with the fewest operations, prioritizing lexicographically smallest result.

Easy
2707

Extra Characters in a String

The problem asks for the minimum number of extra characters left after optimally breaking a string into substrings found…

Medium
2710

Remove Trailing Zeros From a String

Remove trailing zeros from a string representing a positive integer number.

Easy
2712

Minimum Cost to Make All Characters Equal

Find the minimum cost to make all characters of a binary string equal by performing two types of operations.

Medium
2716

Minimize String Length

Minimize String Length asks you to reduce a string by removing duplicates using a Hash Table strategy efficiently.

Easy
2719

Count of Integers

Count of Integers challenges you to find the number of integers with a digit sum between a given range using dynamic pro…

Hard
2730

Find the Longest Semi-Repetitive Substring

Find the length of the longest substring where at most one adjacent pair of digits repeats, using a sliding window appro…

Medium
2734

Lexicographically Smallest String After Substring Operation

Given a string, perform operations to make it lexicographically smaller using a greedy approach with substring modificat…

Medium
2744

Find Maximum Number of String Pairs

Find the maximum number of pairs of distinct strings from an array where one string is the reverse of the other.

Easy
2746

Decremental String Concatenation

Solve the Decremental String Concatenation problem by applying dynamic programming to minimize string length after conca…

Medium
2767

Partition String Into Minimum Beautiful Substrings

Partition a binary string into the fewest beautiful substrings using state transition dynamic programming and careful su…

Medium
2781

Length of the Longest Valid Substring

This problem asks for the longest valid substring of a word that doesn't contain any substrings from a forbidden list.

Hard
2785

Sort Vowels in a String

Sort Vowels in a String requires identifying vowels in a string and rearranging them in ascending order while keeping co…

Medium
2788

Split Strings by Separator

Split Strings by Separator requires iterating through an array of strings and splitting each by a given separator charac…

Easy
2800

Shortest String That Contains Three Strings

Find the shortest string containing three given strings using a greedy approach while ensuring it is lexicographically s…

Medium
2801

Count Stepping Numbers in Range

Count the stepping numbers in a range using dynamic programming with state transitions between digits.

Hard
2810

Faulty Keyboard

Simulate typing on a faulty keyboard where pressing 'i' reverses the string, requiring careful string manipulation track…

Easy
2825

Make String a Subsequence Using Cyclic Increments

Determine if str2 can be made a subsequence of str1 by incrementing characters cyclically using at most one operation.

Medium
2828

Check if a String Is an Acronym of Words

Check if a string can be formed by concatenating the first letters of each word in a given list.

Easy
2833

Furthest Point From Origin

Determine the maximum distance from origin using string moves and counting underscores optimally for efficient calculati…

Easy
2839

Check if Strings Can be Made Equal With Operations I

Determine if two strings can be made equal by repeatedly swapping characters at any two indices in each string.

Easy
2840

Check if Strings Can be Made Equal With Operations II

Check if two strings can be made equal using operations that swap characters with the same parity.

Medium
2842

Count K-Subsequences of a String With Maximum Beauty

Determine the number of k-length unique subsequences in a string that maximize the sum of character frequencies efficien…

Hard
2844

Minimum Operations to Make a Special Number

Minimize operations to make a number divisible by 25 by deleting digits. Use greedy choice and invariant validation.

Medium
2851

String Transformation

Find how many ways string s can be transformed into string t in exactly k operations using suffix rotations.

Hard
2864

Maximum Odd Binary Number

Rearrange a binary string to form the largest odd binary number using a greedy approach and least significant bit valida…

Easy
2896

Apply Operations to Make Two Strings Equal

Apply Operations to Make Two Strings Equal involves transforming binary strings with a cost-based dynamic programming ap…

Medium
2900

Longest Unequal Adjacent Groups Subsequence I

Find the longest alternating subsequence in a string array based on a binary group array.

Easy
2901

Longest Unequal Adjacent Groups Subsequence II

Find the longest subsequence of indices such that the corresponding strings have a valid Hamming distance and group cons…

Medium
2904

Shortest and Lexicographically Smallest Beautiful String

Find the shortest beautiful substring in a binary string and return the lexicographically smallest option efficiently us…

Medium
2911

Minimum Changes to Make K Semi-palindromes

Minimize the number of letter changes to partition a string into k semi-palindromes using dynamic programming and two po…

Hard
2914

Minimum Number of Changes to Make Binary String Beautiful

This problem involves determining the minimum number of changes to make a binary string beautiful using string-driven st…

Medium
2933

High-Access Employees

Identify employees with high system access within one-hour periods based on access logs.

Medium
2937

Make Three Strings Equal

Determine the minimum number of operations to make three strings equal by removing rightmost characters from one string …

Easy
2938

Separate Black and White Balls

Solve the "Separate Black and White Balls" problem by swapping adjacent balls to group all black balls to the right with…

Medium
2942

Find Words Containing Character

Identify all indices of words containing a specific character using array and string traversal techniques efficiently.

Easy
2947

Count Beautiful Substrings I

Given a string and a value k, count the number of beautiful substrings where vowels * consonants % k == 0.

Medium
2949

Count Beautiful Substrings II

Count Beautiful Substrings II focuses on finding beautiful substrings with hash tables and number theory techniques.

Hard
2953

Count Complete Substrings

Count Complete Substrings involves finding substrings where each character appears exactly k times with constraints on a…

Hard
2957

Remove Adjacent Almost-Equal Characters

Minimize operations to remove adjacent almost-equal characters using dynamic programming and greedy methods.

Medium
2976

Minimum Cost to Convert String I

This problem asks to calculate the minimum cost to convert a string from source to target using specific character trans…

Medium
2977

Minimum Cost to Convert String II

Compute the minimum cost to transform source into target using substring replacements with given costs efficiently using…

Hard
2981

Find Longest Special Substring That Occurs Thrice I

Find the longest special substring in a string that appears at least three times, or return -1 if no such substring exis…

Medium
2982

Find Longest Special Substring That Occurs Thrice II

Find the longest special substring that occurs at least three times in a given string using binary search and hash table…

Medium
2983

Palindrome Rearrangement Queries

Given a string and queries, check if rearranging specified substrings can make the string a palindrome.

Hard
2999

Count the Number of Powerful Integers

Count the number of powerful integers in a given range by applying state transition dynamic programming with constraints…

Hard
3003

Maximize the Number of Partitions After Operations

Maximizing the number of partitions in a string after changing one character and applying partitioning operations using …

Hard
3006

Find Beautiful Indices in the Given Array I

Identify all beautiful indices where substring a appears and a nearby substring b exists within distance k efficiently.

Medium
3008

Find Beautiful Indices in the Given Array II

Find Beautiful Indices in the Given Array II challenges you to use binary search and string matching techniques.

Hard
3014

Minimum Number of Pushes to Type Word I

Calculate the minimum pushes to type a word using a remapped telephone keypad with greedy allocation of letters.

Easy
3016

Minimum Number of Pushes to Type Word II

Given a word, find the minimum number of pushes to type it on a remapped keypad using a greedy approach.

Medium
3019

Number of Changing Keys

Count how many times a user switches keys in a typed string, ignoring shift and caps lock variations in characters.

Easy
3029

Minimum Time to Revert Word to Initial State I

Determine the minimum seconds to revert a string to its original state using repeated prefix shifts of length k efficien…

Medium
3031

Minimum Time to Revert Word to Initial State II

The problem asks to calculate the minimum time required to revert a string to its initial state using specific operation…

Hard
3035

Maximum Palindromes After Operations

The problem focuses on maximizing the number of palindromes that can be formed from a given list of words through specif…

Medium
3042

Count Prefix and Suffix Pairs I

Count all index pairs where one word is both a prefix and suffix of another, using efficient array and string checks.

Easy
3043

Find the Length of the Longest Common Prefix

Determine the length of the longest common prefix between two integer arrays using array scanning and hash lookup effici…

Medium
3045

Count Prefix and Suffix Pairs II

Count the number of index pairs in a string array where one word is both a prefix and suffix of another using array and …

Hard
3076

Shortest Uncommon Substring in an Array

Find the shortest substring for each string in an array that does not appear in any other string efficiently using hashi…

Medium
3081

Replace Question Marks in String to Minimize Its Value

Minimize the cost of a string with '?' characters by replacing them with letters in lexicographical order while minimizi…

Medium
3083

Existence of a Substring in a String and Its Reverse

Check for any substring of length 2 in a string and its reverse using a hash table and string comparison.

Easy
3084

Count Substrings Starting and Ending with Given Character

Given a string and a character, find the total number of substrings that start and end with that character.

Medium
3085

Minimum Deletions to Make String K-Special

Minimize deletions to make a string k-special by adjusting character frequencies.

Medium
3090

Maximum Length Substring With Two Occurrences

Find the maximum length substring where some substring occurs at least twice using a sliding window and hash mapping str…

Easy
3093

Longest Common Suffix Queries

Find the index of the string in wordsContainer with the longest common suffix for each query efficiently using array and…

Hard
3106

Lexicographically Smallest String After Operations With Constraint

Minimize a string lexicographically using a series of operations constrained by a given integer k.

Medium
3110

Score of a String

Calculate the sum of absolute ASCII differences between adjacent characters to score any given string efficiently.

Easy
3114

Latest Time You Can Obtain After Replacing Characters

Given a time string with "?" characters, replace them to form the latest valid 12-hour time.

Easy
3120

Count the Number of Special Characters I

Count the number of special characters in a given string using hash tables and string manipulation.

Easy
3121

Count the Number of Special Characters II

Count the Number of Special Characters II is a medium difficulty string and hash table problem that involves identifying…

Medium
3136

Valid Word

Determine if a given string qualifies as a valid word using a string-driven solution pattern with explicit character rul…

Easy
3137

Minimum Number of Operations to Make Word K-Periodic

The problem requires calculating the minimum number of operations to make a string k-periodic using specific substring r…

Medium
3138

Minimum Length of Anagram Concatenation

The problem asks to find the minimum length of a string t such that s is a concatenation of anagrams of t.

Medium
3143

Maximum Points Inside the Square

Find the maximum number of points inside a valid square centered at the origin using a scanning and hashing approach.

Medium
3144

Minimum Substring Partition of Equal Character Frequency

Partition a string into substrings with equal character frequencies using dynamic programming and state transitions.

Medium
3146

Permutation Difference between Two Strings

Compute the total index difference between two strings by mapping characters and summing their positional distances effi…

Easy
3163

String Compression III

Compress a string by repeatedly taking maximal same-character prefixes, following a string-driven solution strategy effi…

Medium
3168

Minimum Number of Chairs in a Waiting Room

Calculate the minimum number of chairs needed in a waiting room using string simulation and event tracking efficiently.

Easy
3170

Lexicographically Minimum String After Removing Stars

Find the lexicographically smallest string by removing stars using stack-based state management and careful character se…

Medium
3174

Clear Digits

Remove all digits from a given string by applying a repeated operation to form the final string without digits.

Easy
3210

Find the Encrypted String

In this problem, you need to encrypt a string by shifting each character's position based on a given integer value.

Easy
3211

Generate Binary Strings Without Adjacent Zeros

Generate all binary strings of length n without adjacent zeros using backtracking search with pruning for efficient enum…

Medium
3213

Construct String with Minimum Cost

This problem asks you to construct a target string using given words at minimal cost using dynamic programming technique…

Hard
3216

Lexicographically Smallest String After a Swap

Lexicographically Smallest String After a Swap involves finding the smallest string after swapping adjacent digits with …

Easy
3223

Minimum Length of String After Operations

Find the minimum length of a string after performing operations based on character frequency.

Medium
3227

Vowels Game in a String

Solve the Vowels Game in a String using optimal moves and string analysis to predict the winner efficiently and accurate…

Medium
3228

Maximum Number of Operations to Move Ones to the End

This problem requires finding the maximum number of operations to move ones to the end of a binary string.

Medium
3234

Count the Number of Substrings With Dominant Ones

Count the number of substrings in a binary string with dominant ones, using a sliding window approach with state updates…

Medium
3248

Snake in Matrix

Solve the Snake in Matrix problem by simulating the snake's movement in a grid based on a series of directional commands…

Easy
3258

Count Substrings That Satisfy K-Constraint I

Count all substrings in a binary string that meet a given k-constraint using an efficient sliding window approach.

Easy
3260

Find the Largest Palindrome Divisible by K

Compute the largest n-digit integer divisible by k that forms a palindrome using state transition dynamic programming te…

Hard
3261

Count Substrings That Satisfy K-Constraint II

Count Substrings That Satisfy K-Constraint II requires finding valid substrings in a binary string based on a k-constrai…

Hard
3271

Hash Divided String

Hash Divided String requires splitting a string into equal parts and combining character values modulo 26 to form a new …

Medium
3274

Check if Two Chessboard Squares Have the Same Color

Determine if two chessboard squares share the same color using coordinate math and simple string manipulation for quick …

Easy
3280

Convert Date to Binary

Convert a given Gregorian date string to its binary format by transforming year, month, and day individually without lea…

Easy
3291

Minimum Number of Valid Strings to Form Target I

Use dynamic programming to split target into the fewest prefixes that match any word prefix, while ruling out dead posit…

Medium
3292

Minimum Number of Valid Strings to Form Target II

Compute the minimum number of valid strings from an array needed to construct a given target string efficiently using dy…

Hard
3295

Report Spam Message

Determine if a message contains at least two banned words using array scanning and hash lookup.

Medium
3297

Count Substrings That Can Be Rearranged to Contain a String I

Count the number of valid substrings in word1 that can be rearranged to contain word2 as a prefix.

Medium
3298

Count Substrings That Can Be Rearranged to Contain a String II

Count Substrings That Can Be Rearranged to Contain a String II involves identifying valid substrings with a sliding wind…

Hard
3302

Find the Lexicographically Smallest Valid Sequence

Determine the lexicographically smallest valid index sequence by using state transition dynamic programming over word1 a…

Medium
3303

Find the Occurrence of First Almost Equal Substring

Locate the first substring in s that is almost equal to pattern by allowing at most one character mismatch efficiently.

Hard
3305

Count of Substrings Containing Every Vowel and K Consonants I

Count all substrings containing every vowel and exactly k consonants using a sliding window and hash map state tracking.

Medium
3306

Count of Substrings Containing Every Vowel and K Consonants II

Count the number of substrings containing all vowels and exactly k consonants using a sliding window technique.

Medium
3316

Find Maximum Removals From Source String

Determine the maximum number of characters you can remove from source while keeping pattern as a subsequence using array…

Medium
3320

Count The Number of Winning Sequences

Count The Number of Winning Sequences is a dynamic programming challenge involving state transitions based on Alice’s cr…

Hard
3324

Find the Sequence of Strings Appeared on the Screen

Simulate Alice typing a target string with a special keyboard that appends letters one by one. Solve using string simula…

Medium
3325

Count Substrings With K-Frequency Characters I

Calculate the total number of substrings where at least one character repeats k times using a sliding window efficiently…

Medium
3327

Check if DFS Strings Are Palindromes

Determine if strings formed by DFS traversal of a tree are palindromes using array scanning and hash lookups efficiently…

Hard
3330

Find the Original Typed String I

Determine the length of the original string Alice intended to type by analyzing repeated characters and clumsy key press…

Easy
3331

Find Subtree Sizes After Changes

Calculate the sizes of all subtrees after simultaneous parent changes using array scanning and hash-based counting effic…

Medium
3333

Find the Original Typed String II

Calculate how many potential original strings Alice might have intended to type, considering her clumsy typing behavior.

Hard
3335

Total Characters in String After Transformations I

Calculate the total number of characters in a string after repeated transformations using dynamic programming and freque…

Medium
3337

Total Characters in String After Transformations II

Calculate the length of a string after repeated transformations using state transition dynamic programming for large t v…

Hard
3340

Check Balanced String

Determine if a numeric string is balanced by comparing sums of digits at even and odd positions efficiently.

Easy
3343

Count Number of Balanced Permutations

Determine how many distinct permutations of a digit string are balanced using state transition dynamic programming effic…

Hard
3348

Smallest Divisible Digit Product II

Find the smallest zero-free number at least as large as num whose digits multiply to a product divisible by t using care…

Hard
3352

Count K-Reducible Numbers Less Than N

This problem challenges you to count the K-reducible numbers less than a given binary integer using dynamic programming.

Hard
3361

Shift Distance Between Two Strings

Find the minimum cost of transforming one string into another, considering operations between characters.

Medium
3365

Rearrange K Substrings to Form Target String

Determine if s can be split into k equal substrings and rearranged to match t using a hash table for frequency tracking.

Medium
3387

Maximize Amount After Two Days of Conversions

Compute the maximum currency amount after two days using graph traversal and depth-first search for optimal conversions.

Medium
3389

Minimum Operations to Make Character Frequencies Equal

This Hard problem asks to transform a string so all character frequencies match using minimal deletions, leveraging dyna…

Hard
3399

Smallest Substring With Identical Characters II

Find the minimal length of a substring with identical characters using binary search and controlled character flips effi…

Hard
3403

Find the Lexicographically Largest String From the Box I

This problem involves finding the lexicographically largest string from a given word using a two-pointer approach.

Medium
3407

Substring Matching Pattern

Determine if a pattern containing a single wildcard can match any substring of a given string efficiently.

Easy
3412

Find Mirror Score of a String

Calculate the mirror score of a string using stack-based state management for matching letters efficiently and accuratel…

Medium
3435

Frequencies of Shortest Supersequences

Compute all unique shortest common supersequences of given words using graph indegree tracking and topological ordering …

Hard
3438

Find Valid Pair of Adjacent Digits in String

Identify the first valid adjacent digit pair in a string where each digit appears exactly as many times as its numeric v…

Easy
3441

Minimum Cost Good Caption

Solve Minimum Cost Good Caption with dynamic programming that builds minimum edit cost while enforcing character runs of…

Hard
3442

Maximum Difference Between Even and Odd Frequency I

Find the maximum difference between the frequency of characters in a string with odd and even frequencies.

Easy
3443

Maximum Manhattan Distance After K Changes

Solve Maximum Manhattan Distance After K Changes by scanning prefixes and testing the four diagonal target pairs with li…

Medium
3445

Maximum Difference Between Even and Odd Frequency II

Find the maximum difference between even and odd character frequencies in substrings using sliding window updates effici…

Hard
3448

Count Substrings Divisible By Last Digit

Count the number of substrings in a string divisible by their last non-zero digit using dynamic programming.

Hard
3455

Shortest Matching Substring

Find the shortest substring in a string that matches a pattern with exactly two wildcards efficiently using binary searc…

Hard
3456

Find Special Substring of Length K

Check efficiently if a string contains a consecutive sequence of length k where all characters match exactly one distinc…

Easy
3458

Select K Disjoint Special Substrings

Determine if k non-overlapping special substrings exist in a string using dynamic programming and careful substring trac…

Medium
3461

Check If Digits Are Equal in String After Operations I

Simulate repeated adjacent digit sums modulo 10 until two digits remain, then check whether those final digits match.

Easy
3463

Check If Digits Are Equal in String After Operations II

Determine if repeated digit-sum operations on a numeric string reduce it to two equal digits using math and string techn…

Hard
3472

Longest Palindromic Subsequence After at Most K Operations

Find the longest palindromic subsequence of a string after performing at most k operations to adjust letters.

Medium
3474

Lexicographically Smallest Generated String

Generate the lexicographically smallest string by merging str1 and str2 using a greedy approach with invariant checks.

Hard
3484

Design Spreadsheet

Design a spreadsheet that supports setting, retrieving, and resetting values, with the ability to handle formulas refere…

Medium
3485

Longest Common Prefix of K Strings After Removal

Find the longest common prefix length of k strings after removing an element in the array.

Hard
3498

Reverse Degree of a String

Calculate the reverse degree of a string by simulating operations on its characters based on their positions in the alph…

Easy
3499

Maximize Active Section with Trade I

Maximize the number of active sections in a binary string by performing at most one trade operation.

Medium
3501

Maximize Active Section with Trade II

Maximize the number of active sections in a binary string with at most one trade.

Hard
3503

Longest Palindrome After Substring Concatenation I

Compute the maximum palindrome length by concatenating substrings from two strings using state transition dynamic progra…

Medium
3504

Longest Palindrome After Substring Concatenation II

Compute the longest palindrome by concatenating substrings from two strings using state transition dynamic programming e…

Hard
3517

Smallest Palindromic Rearrangement I

Build the smallest palindrome by sorting the left half counts and mirroring them around the optional middle character.

Medium
3518

Smallest Palindromic Rearrangement II

Find the k-th lexicographically smallest palindromic rearrangement of a given palindromic string s.

Hard
3519

Count Numbers with Non-Decreasing Digits

Count all integers between l and r whose digits never decrease in base b using state transition dynamic programming effi…

Hard
3522

Calculate Score After Performing Instructions

Simulate a series of add and jump instructions on arrays to compute the final score efficiently using array scanning and…

Medium
3527

Find the Most Common Response

Find the most common survey response after eliminating duplicates within each day, using array scanning and hash lookups…

Medium
3529

Count Cells in Overlapping Horizontal and Vertical Substrings

Efficiently count grid cells appearing in both horizontal and vertical occurrences of a given string pattern using array…

Medium
3541

Find Most Frequent Vowel and Consonant

Given a string, calculate the sum of the most frequent vowel and consonant frequencies.

Easy
3545

Minimum Deletions for At Most K Distinct Characters

You need to delete characters in a string to reduce its distinct characters to at most k.

Easy
3556

Sum of Largest Prime Substrings

Compute the sum of the three largest unique primes from all substrings using hash table plus math efficiently.

Medium
3557

Find Maximum Number of Non Intersecting Substrings

Determine the maximum number of non-overlapping substrings in a word, each at least four characters and matching start-e…

Medium
3561

Resulting String After Adjacent Removals

This problem focuses on removing adjacent characters in a string using a stack-based approach until no more operations a…

Medium
3563

Lexicographically Smallest String After Adjacent Removals

Find the lexicographically smallest string by repeatedly removing adjacent characters optimally using dynamic programmin…

Hard
3579

Minimum Steps to Convert String with Operations

Transform word1 into word2 using minimal operations on substrings with a dynamic programming state transition approach.

Hard
3582

Generate Tag for Video Caption

Transform a video caption into a valid hashtag by simulating capitalization rules and truncation for long words efficien…

Easy
3597

Partition String

Partition a string into unique segments using hash table and string manipulation.

Medium
3598

Longest Common Prefix Between Adjacent Strings After Removals

Given an array of strings, find the longest common prefix length between adjacent strings after removals at each index.

Medium
3602

Hexadecimal and Hexatrigesimal Conversion

Solve Hexadecimal and Hexatrigesimal Conversion by converting n squared to base 16 and n cubed to base 36, then joining …

Easy
3606

Coupon Code Validator

The Coupon Code Validator problem requires filtering and sorting coupons based on specific criteria for validity.

Easy
3612

Process String with Special Operations I

Simulate a series of operations on a string to transform it into the desired result using special characters.

Medium
3614

Process String with Special Operations II

Solve the problem of processing strings with special operations like '*' and '#' by simulating the rules left-to-right.

Hard
3615

Longest Palindromic Path in Graph

Find the longest path in a graph that forms a palindrome using state transition dynamic programming and bitmask techniqu…

Hard

Related Patterns

String LeetCode Problems: 699 Solutions