String
LeetCode 151: Reverse Words in a String
·1 min
LeetCode
Medium
Two-Pointers
String
LeetCode 151 note: split() with no argument treats runs of spaces as one separator and drops leading and trailing spaces; reverse and join with single spaces
LeetCode 93: Restore IP Addresses
·2 mins
LeetCode
Medium
String
Backtracking
LeetCode 93 note: cut into exactly 4 pieces, each 1 to 3 digits long, valued 0 to 255, with no leading zero except 0 itself
LeetCode 647: Palindromic Substrings
·2 mins
LeetCode
Medium
Two-Pointers
String
Dynamic-Programming
LeetCode 647 note: expand around centers, counting one palindromic substring for each successful expansion
LeetCode 131: Palindrome Partitioning
·2 mins
LeetCode
Medium
String
Dynamic-Programming
Backtracking
LeetCode 131 note: each level cuts a palindrome from the front of the remaining string, trying every length from 1 to the whole remainder
LeetCode 208: Implement Trie (Prefix Tree)
·2 mins
LeetCode
Medium
Hash-Table
String
Design
Trie
LeetCode 208 note: each node is a children dict plus an is_end flag; insert, search and startsWith all walk down character by character
LeetCode 981: Time Based Key-Value Store
·2 mins
LeetCode
Medium
Hash-Table
String
Binary-Search
Design
LeetCode 981 note: store a (timestamp, value) list per key, with timestamps increasing; get binary searches the last timestamp <= the query
LeetCode 424: Longest Repeating Character Replacement
·2 mins
LeetCode
Medium
Hash-Table
String
Sliding-Window
LeetCode 424 note: a variable sliding window where window length minus the top character count is the number of replacements; shrink when it exceeds k
LeetCode 79: Word Search
·3 mins
LeetCode
Medium
Array
String
Backtracking
Depth-First-Search
LeetCode 79 note: backtrack from every cell, matching the next character in four directions with visited cells marked temporarily and restored; prune early with character counts
LeetCode 71: Simplify Path
·2 mins
LeetCode
Medium
String
Stack
LeetCode 71 note: split on /, skip empty pieces and ., pop on .. (never above root), push other names, and join with /
LeetCode 49: Group Anagrams
·2 mins
LeetCode
Medium
Array
Hash-Table
String
Sorting
LeetCode 49 note: use each string’s sorted form as a key; strings sharing a key form one anagram group
LeetCode 43: Multiply Strings
·2 mins
LeetCode
Medium
Math
String
Simulation
LeetCode 43 note: num1[i] × num2[j] lands at position i + j + 1; accumulate into an array of length n + m and carry at the end
LeetCode 5: Longest Palindromic Substring
·2 mins
LeetCode
Medium
Two-Pointers
String
Dynamic-Programming
Manacher
LeetCode 5 note: expand around centers, using each position as an odd and an even center; with interval DP, iterate i from large to small