String | LeetCode Problems

365 String solutions to LeetCode solutions.

String Problems View all solutions →

Longest Substring Without Repeating Characters

#3 Medium

Longest Palindromic Substring

#5 Medium

ZigZag Conversion

#6 Medium

String to Integer (atoi)

#8 Medium

Regular Expression Matching

#10 Hard

Integer to Roman

#12 Medium

Roman to Integer

#13 Easy

Longest Common Prefix

#14 Easy

Letter Combinations of a Phone Number

#17 Medium

Valid Parentheses

#20 Easy

Generate Parentheses

#22 Medium

Implement strStr()

#28 Easy

Substring with Concatenation of All Words

#30 Hard

Longest Valid Parentheses

#32 Hard

Count and Say

#38 Medium

Multiply Strings

#43 Medium

Wildcard Matching

#44 Hard

Group Anagrams

#49 Medium

Length of Last Word

#58 Easy

Valid Number

#65 Hard

Add Binary

#67 Easy

Text Justification

#68 Hard

Simplify Path

#71 Medium

Edit Distance

#72 Medium

Minimum Window Substring

#76 Hard

Word Search

#79 Medium

Scramble String

#87 Hard

Decode Ways

#91 Medium

Restore IP Addresses

#93 Medium

Interleaving String

#97 Medium

Distinct Subsequences

#115 Hard

Valid Palindrome

#125 Easy

Word Ladder II

#126 Hard

Word Ladder

#127 Hard

Palindrome Partitioning

#131 Medium

Palindrome Partitioning II

#132 Hard

Word Break

#139 Medium

Word Break II

#140 Hard

Reverse Words in a String

#151 Medium

Compare Version Numbers

#165 Medium

Fraction to Recurring Decimal

#166 Medium

Excel Sheet Column Title

#168 Easy

Excel Sheet Column Number

#171 Easy

Largest Number

#179 Medium

Repeated DNA Sequences

#187 Medium

Isomorphic Strings

#205 Easy

Implement Trie (Prefix Tree)

#208 Medium

Design Add and Search Words Data Structure

#211 Medium

Word Search II

#212 Hard

Shortest Palindrome

#214 Hard

Basic Calculator

#224 Hard

Basic Calculator II

#227 Medium

Different Ways to Add Parentheses

#241 Medium

Valid Anagram

#242 Easy

Binary Tree Paths

#257 Easy

Integer to English Words

#273 Hard

Expression Add Operators

#282 Hard

Word Pattern

#290 Easy

Serialize and Deserialize Binary Tree

#297 Hard

Bulls and Cows

#299 Medium

Remove Invalid Parentheses

#301 Hard

Additive Number

#306 Medium

Remove Duplicate Letters

#316 Medium

Maximum Product of Word Lengths

#318 Medium

Verify Preorder Serialization of a Binary Tree

#331 Medium

Palindrome Pairs

#336 Hard

Reverse String

#344 Easy

Reverse Vowels of a String

#345 Easy

Ransom Note

#383 Easy

Mini Parser

#385 Medium

First Unique Character in a String

#387 Easy

Longest Absolute File Path

#388 Medium

Find the Difference

#389 Easy

Is Subsequence

#392 Easy

Decode String

#394 Medium

Longest Substring with At Least K Repeating Characters

#395 Medium

Evaluate Division

#399 Medium

Remove K Digits

#402 Medium

Longest Palindrome

#409 Easy

Fizz Buzz

#412 Easy

Add Strings

#415 Easy

Strong Password Checker

#420 Hard

Reconstruct Original Digits from English

#423 Medium

Longest Repeating Character Replacement

#424 Medium

Minimum Genetic Mutation

#433 Medium

Number of Segments in a String

#434 Easy

Find All Anagrams in a String

#438 Medium

String Compression

#443 Medium

Serialize and Deserialize BST

#449 Medium

Sort Characters By Frequency

#451 Medium

Repeated Substring Pattern

#459 Easy

Count The Repetitions

#466 Hard

Unique Substrings in Wraparound String

#467 Medium

Validate IP Address

#468 Medium

Concatenated Words

#472 Hard

Ones and Zeroes

#474 Medium

Magical String

#481 Medium

License Key Formatting

#482 Easy

Zuma Game

#488 Hard

Keyboard Row

#500 Easy

Freedom Trail

#514 Hard

Longest Palindromic Subsequence

#516 Medium

Detect Capital

#520 Easy

Longest Uncommon Subsequence I

#521 Easy

Longest Uncommon Subsequence II

#522 Medium

Longest Word in Dictionary through Deleting

#524 Medium

Encode and Decode TinyURL

#535 Medium

Complex Number Multiplication

#537 Medium

Minimum Time Difference

#539 Medium

Reverse String II

#541 Easy

Student Attendance Record I

#551 Easy

Next Greater Element III

#556 Medium

Reverse Words in a String III

#557 Easy

Find the Closest Palindrome

#564 Hard

Permutation in String

#567 Medium

Delete Operation for Two Strings

#583 Medium

Tag Validator

#591 Hard

Fraction Addition and Subtraction

#592 Medium

Minimum Index Sum of Two Lists

#599 Easy

Construct String from Binary Tree

#606 Easy

Find Duplicate File in System

#609 Medium

Decode Ways II

#639 Hard

Solve the Equation

#640 Medium

Palindromic Substrings

#647 Medium

Replace Words

#648 Medium

Dota2 Senate

#649 Medium

Robot Return to Origin

#657 Easy

Strange Printer

#664 Hard

Implement Magic Dictionary

#676 Medium

Map Sum Pairs

#677 Medium

Valid Parenthesis String

#678 Medium

Valid Palindrome II

#680 Easy

Repeated String Match

#686 Easy

Stickers to Spell Word

#691 Hard

Top K Frequent Words

#692 Medium

Count Binary Substrings

#696 Easy

To Lower Case

#709 Easy

Minimum ASCII Delete Sum for Two Strings

#712 Medium

Longest Word in Dictionary

#720 Medium

Accounts Merge

#721 Medium

Remove Comments

#722 Medium

Number of Atoms

#726 Hard

Count Different Palindromic Subsequences

#730 Hard

Parse Lisp Expression

#736 Hard

Prefix and Suffix Search

#745 Hard

Shortest Completing Word

#748 Easy

Open the Lock

#752 Medium

Special Binary String

#761 Hard

Partition Labels

#763 Medium

Reorganize String

#767 Medium

Basic Calculator IV

#770 Hard

Jewels and Stones

#771 Easy

Swap Adjacent in LR String

#777 Medium

Letter Case Permutation

#784 Medium

Custom Sort String

#791 Medium

Number of Matching Subsequences

#792 Medium

Rotate String

#796 Easy

Unique Morse Code Words

#804 Easy

Number of Lines To Write String

#806 Easy

Expressive Words

#809 Medium

Subdomain Visit Count

#811 Medium

Ambiguous Coordinates

#816 Medium

Most Common Word

#819 Easy

Short Encoding of Words

#820 Medium

Shortest Distance to a Character

#821 Easy

Goat Latin

#824 Easy

Count Unique Characters of All Substrings of a Given String

#828 Hard

Positions of Large Groups

#830 Easy

Masking Personal Information

#831 Medium

Find And Replace in String

#833 Medium

Push Dominoes

#838 Medium

Similar String Groups

#839 Hard

Split Array into Fibonacci Sequence

#842 Medium

Guess the Word

#843 Hard

Backspace String Compare

#844 Easy

Shifting Letters

#848 Medium

K-Similar Strings

#854 Hard

Score of Parentheses

#856 Medium

Buddy Strings

#859 Easy

Decoded String at Index

#880 Medium

Uncommon Words from Two Sentences

#884 Easy

Find and Replace Pattern

#890 Medium

Groups of Special-Equivalent Strings

#893 Medium

Orderly Queue

#899 Hard

Numbers At Most N Given Digit Set

#902 Hard

Valid Permutations for DI Sequence

#903 Hard

Super Palindromes

#906 Hard

Word Subsets

#916 Medium

Reverse Only Letters

#917 Easy

Minimum Add to Make Parentheses Valid

#921 Medium

Long Pressed Name

#925 Easy

Flip String to Monotone Increasing

#926 Medium

Unique Email Addresses

#929 Easy

Stamping The Sequence

#936 Hard

Reorder Data in Log Files

#937 Medium

Distinct Subsequences II

#940 Hard

DI String Match

#942 Easy

Find the Shortest Superstring

#943 Hard

Delete Columns to Make Sorted

#944 Easy

Largest Time for Given Digits

#949 Medium

Verifying an Alien Dictionary

#953 Easy

Delete Columns to Make Sorted II

#955 Medium

Delete Columns to Make Sorted III

#960 Hard

Vowel Spellchecker

#966 Medium

Equal Rational Numbers

#972 Hard

Time Based Key-Value Store

#981 Medium

String Without AAA or BBB

#984 Medium

Smallest String Starting From Leaf

#988 Medium

Satisfiability of Equality Equations

#990 Medium

Find Common Characters

#1002 Easy

Check If Word Is Valid After Substitutions

#1003 Medium

Binary String With Substrings Representing 1 To N

#1016 Medium

Remove Outermost Parentheses

#1021 Easy

Camelcase Matching

#1023 Medium

Recover a Tree From Preorder Traversal

#1028 Hard

Stream of Characters

#1032 Hard

Robot Bounded In Circle

#1041 Medium

Longest Duplicate Substring

#1044 Hard

Remove All Adjacent Duplicates In String

#1047 Easy

Longest String Chain

#1048 Medium

Lexicographically Smallest Equivalent String

#1061 Medium

Greatest Common Divisor of Strings

#1071 Easy

Occurrences After Bigram

#1078 Easy

Letter Tile Possibilities

#1079 Medium

Smallest Subsequence of Distinct Characters

#1081 Medium

Shortest Common Supersequence

#1092 Hard

Brace Expansion II

#1096 Hard

Parsing A Boolean Expression

#1106 Hard

Defanging an IP Address

#1108 Easy

Maximum Nesting Depth of Two Valid Parentheses Strings

#1111 Medium

Alphabet Board Path

#1138 Medium

Longest Common Subsequence

#1143 Medium

Longest Chunked Palindrome Decomposition

#1147 Hard

Day of the Year

#1154 Easy

Swap For Longest Repeated Character Substring

#1156 Medium

Find Words That Can Be Formed by Characters

#1160 Easy

Last Substring in Lexicographical Order

#1163 Hard

Invalid Transactions

#1169 Medium

Compare Strings by Frequency of the Smallest Character

#1170 Medium

Can Make Palindrome from Substring

#1177 Medium

Number of Valid Words for Each Puzzle

#1178 Hard

Maximum Number of Balloons

#1189 Easy

Reverse Substrings Between Each Pair of Parentheses

#1190 Medium

Smallest String With Swaps

#1202 Medium

Get Equal Substrings Within Budget

#1208 Medium

Remove All Adjacent Duplicates in String II

#1209 Medium

Split a String in Balanced Strings

#1221 Easy

Remove Sub-Folders from the Filesystem

#1233 Medium

Replace the Substring for Balanced String

#1234 Medium

Maximum Length of a Concatenated String with Unique Characters

#1239 Medium

Minimum Swaps to Make Strings Equal

#1247 Medium

Minimum Remove to Make Valid Parentheses

#1249 Medium

Maximum Score Words Formed by Letters

#1255 Hard

Search Suggestions System

#1268 Medium

Palindrome Partitioning III

#1278 Hard

Iterator for Combination

#1286 Medium

Maximum Number of Occurrences of a Substring

#1297 Medium

Verbal Arithmetic Puzzle

#1307 Hard

Decrypt String from Alphabet to Integer Mapping

#1309 Easy

Minimum Insertion Steps to Make a String Palindrome

#1312 Hard

Distinct Echo Substrings

#1316 Hard

Minimum Distance to Type a Word Using Two Fingers

#1320 Hard

Print Words Vertically

#1324 Medium

Break a Palindrome

#1328 Medium

Remove Palindromic Subsequences

#1332 Easy

Minimum Number of Steps to Make Two Strings Anagram

#1347 Medium

Number of Substrings Containing All Three Characters

#1358 Medium

Number of Days Between Two Dates

#1360 Easy

Rank Teams by Votes

#1366 Medium

Increasing Decreasing String

#1370 Easy

Find the Longest Substring Containing Vowels in Even Counts

#1371 Medium

Generate a String With Characters That Have Odd Counts

#1374 Easy

Longest Happy Prefix

#1392 Hard

Design Underground System

#1396 Medium

Find All Good Strings

#1397 Hard

Construct K Palindrome Strings

#1400 Medium

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

#1404 Medium

Longest Happy String

#1405 Medium

String Matching in an Array

#1408 Easy

HTML Entity Parser

#1410 Medium

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

#1415 Medium

Restore The Array

#1416 Hard

Reformat The String

#1417 Easy

Display Table of Food Orders in a Restaurant

#1418 Medium

Minimum Number of Frogs Croaking

#1419 Medium

Maximum Score After Splitting a String

#1422 Easy

Check If a String Can Break Another String

#1433 Medium

Destination City

#1436 Easy

Consecutive Characters

#1446 Easy

Simplified Fractions

#1447 Medium

Rearrange Words in a Sentence

#1451 Medium

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

#1452 Medium

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

#1455 Easy

Maximum Number of Vowels in a Substring of Given Length

#1456 Medium

Check If a String Contains All Binary Codes of Size K

#1461 Medium

Making File Names Unique

#1487 Medium

Path Crossing

#1496 Easy

Minimum Possible Integer After at Most K Adjacent Swaps On Digits

#1505 Hard

Reformat Date

#1507 Easy

Number of Substrings With Only 1s

#1513 Medium

Maximum Number of Non-Overlapping Substrings

#1520 Hard

Number of Good Ways to Split a String

#1525 Medium

Shuffle String

#1528 Easy

Minimum Suffix Flips

#1529 Medium

String Compression II

#1531 Hard

Can Convert String in K Moves

#1540 Medium

Minimum Insertions to Balance a Parentheses String

#1541 Medium

Find Longest Awesome Substring

#1542 Hard

Make The String Great

#1544 Easy

Find Kth Bit in Nth Binary String

#1545 Medium

Thousand Separator

#1556 Easy

Number of Ways to Split a String

#1573 Medium

Replace All ?'s to Avoid Consecutive Repeating Characters

#1576 Medium

Minimum Time to Make Rope Colorful

#1578 Medium

Check If String Is Transformable With Substring Sort Operations

#1585 Hard

Rearrange Spaces Between Words

#1592 Easy

Split a String Into the Max Number of Unique Substrings

#1593 Medium

Crawler Log Folder

#1598 Easy

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

#1604 Medium

Maximum Nesting Depth of the Parentheses

#1614 Easy

Split Two Strings to Make Palindrome

#1616 Medium

Largest Substring Between Two Equal Characters

#1624 Easy

Lexicographically Smallest String After Applying Operations

#1625 Medium

Slowest Key

#1629 Easy

Count Substrings That Differ by One Character

#1638 Medium

Number of Ways to Form a Target String Given a Dictionary

#1639 Hard

Minimum Deletions to Make Character Frequencies Unique

#1647 Medium

Determine if Two Strings Are Close

#1657 Medium

Maximum Repeating Substring

#1668 Easy

Merge Strings Alternately

#1768 Easy

Minimum Number of Operations to Move All Balls to Each Box

#1769 Medium

Check if One String Swap Can Make Strings Equal

#1790 Easy

Determine Color of a Chessboard Square

#1812 Easy

Check if the Sentence Is Pangram

#1832 Easy

Check if Word Equals Summation of Two Words

#1880 Easy

Remove All Occurrences of a Substring

#1910 Medium

Unique Length-3 Palindromic Subsequences

#1930 Medium

Maximum Number of Words You Can Type

#1935 Easy

Find Unique Binary String

#1980 Medium

Find the Kth Largest Integer in the Array

#1985 Medium

Reverse Prefix of Word

#2000 Easy

Final Value of Variable After Performing Operations

#2011 Easy

Minimum Moves to Convert String

#2027 Easy

Number of Valid Words in a Sentence

#2047 Easy

Kth Distinct String in an Array

#2053 Medium

Count Common Words With One Occurrence

#2085 Easy

Maximum Number of Words Found in Sentences

#2114 Easy

Find All Possible Recipes from Given Supplies

#2115 Medium

Check if a Parentheses String Can Be Valid

#2116 Medium

Capitalize the Title

#2129 Easy

Counting Words With a Given Prefix

#2185 Easy

Construct Smallest Number From DI String

#2375 Medium

Minimum Recolors to Get K Consecutive Black Blocks

#2379 Easy

Shifting Letters II

#2381 Medium

Removing Stars From a String

#2390 Medium

Circular Sentence

#2490 Easy

Count Vowel Strings in Ranges

#2559 Medium

Count the Number of Powerful Integers

#2999 Hard

Count Prefix and Suffix Pairs I

#3042 Easy

Score of a String

#3110 Easy

Clear Digits

#3174 Easy

Minimum Length of String After Operations

#3223 Medium

Count of Substrings Containing Every Vowel and K Consonants II

#3306 Medium

Check If Digits Are Equal in String After Operations I

#3461 Easy

Check If Digits Are Equal in String After Operations II

#3463 Hard