Two Pointers

142. Linked List Cycle II

142. Linked List Cycle II 承上題,這個題目除了要確定題目中的 Linked List 有沒有環,

26. Remove Duplicates from Sorted Array

26. Remove Duplicates from Sorted Array 題目的標題寫的並不是很清楚,這個題目其實是要把 雙指針問題 class

992. Subarrays with K Different Integers

992. Subarrays with K Different Integers 先見算出「最多」 k 個不同的數字的組合,

567. Permutation in String

567. Permutation in String 1. 我們需要想的是窗口增大的時候,需要更新哪些資訊? 2. 如果 char

159. Longest Substring with At Most Two Distinct Characters

159. Longest Substring with At Most Two Distinct Characters class

1234. Replace the Substring for Balanced String

1234. Replace the Substring for Balanced String

1358. Number of Substrings Containing All Three Characters

1358. Number of Substrings Containing All Three Characters

977. Squares of a Sorted Array

997. Squares of a Sorted Array 這一個題目的問題是給定一個排序好的陣列,計算出所有數字的次方後,再依序由小排到大。 給定的排序好的陣列看似很貼心,