String
LeetCode 67: Add Binary
·2 mins
LeetCode
Easy
Math
String
Bit-Manipulation
Simulation
LeetCode 67 note: add from the ends of both strings digit by digit, with carry sum // 2 and digit sum % 2
LeetCode 58: Length of Last Word
·1 min
LeetCode
Easy
String
LeetCode 58 note: split() with no argument ignores trailing spaces; return the length of the last word
LeetCode 28: Find the Index of the First Occurrence in a String
·1 min
LeetCode
Easy
Two-Pointers
String
String-Matching
Z-Algorithm
LeetCode 28 note: try matching needle at every start, or use str.find; index raises when not found
LeetCode 14: Longest Common Prefix
·2 mins
LeetCode
Easy
Array
String
Trie
LeetCode 14 note: bound by the shortest string and check each position across all strings; the first mismatch gives the answer’s length
LeetCode 13: Roman to Integer
·1 min
LeetCode
Easy
Hash-Table
Math
String
LeetCode 13 note: add each symbol’s value left to right, subtracting instead when it is smaller than the symbol to its right