Two-Pointers
LeetCode 125: Valid Palindrome
·2 mins
LeetCode
Easy
Two-Pointers
String
LeetCode 125 note: two pointers skip non-alphanumeric characters and compare lowercase letters, with digits included
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 27: Remove Element
·1 min
LeetCode
Easy
Array
Two-Pointers
LeetCode 27 note: the write pointer copies only values not equal to val, returning how many were written
LeetCode 26: Remove Duplicates from Sorted Array
·2 mins
LeetCode
Easy
Array
Two-Pointers
LeetCode 26 note: overwrite in place with a write pointer for the next slot, writing only values different from the last one written