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
Implement a function that finds the first character that appears only once in a character stream. For example, after reading only the first two characters "go", the first character that appears once is "g".
- Subarray Sum Equals Khistorical
Given an integer array and an integer k, find the number of contiguous subarrays whose sum equals k.
- Left Rotate Stringhistorical
Assembly language has a shift instruction called rotate left (ROL). This task uses a string to simulate its result. Given a character sequence S, output the sequence after cyclically rotating it K positions to the left.
- Maximal Squarehistorical
In a 2D matrix consisting of '0' and '1', find the largest square containing only '1' and return its area.
- Poker Straighthistorical
Determine whether five playing cards can form a straight, allowing jokers to represent any number.
- Daily Temperatureshistorical
Given a list of daily temperatures, generate a new list where each position contains the minimum number of days you must wait to observe a warmer temperature.
- Replace Spaceshistorical
Implement a function that replaces every space in a string with "%20". For example, when the string is We Are Happy., the result after replacement is We%20Are%20Happy.
- Daily Temperatureshistorical
Given a list of daily temperatures, generate a new list where each position contains the minimum number of days you must wait to observe a warmer temperature.
- Print Linked List from Tail to Headhistorical
Given a linked list, return an ArrayList containing its values from tail to head.
- Sliding Window Maximumhistorical
Slide a window of length k across an array from left to right and return the maximum value in each window.