Data Structures & Algorithms
237 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- First Non-Repeating Character in a Character Streamhistorical
Use a map to count character occurrences while preserving input order to find the first character that appears only once in a stream.
- Subarray Sum Equals Khistorical
LeetCode notes on the brute-force solution for Subarray Sum Equals K.
- Left Rotate Stringhistorical
Record two implementations of cyclic left rotation of a string: slicing and concatenation, and three reversals.
- Poker Straighthistorical
Sort five cards, treat jokers as 0, and use the gaps between non-zero cards to determine whether they can form a straight.
- Replace Spaceshistorical
Record two implementations for replacing spaces with %20: character-by-character concatenation and preallocated storage.
- Daily Temperatureshistorical
LeetCode notes on Daily Temperatures with brute force and a monotonic stack.
- Print Linked List from Tail to Headhistorical
Record recursive and stack-based methods for outputting a linked list from tail to head.
- Sliding Window Maximumhistorical
LeetCode notes on Sliding Window Maximum using brute force, a priority queue, and a monotonic deque.