status
date
slug
tags
category
type
password
icon
本文目錄
 

前言

太簡單的題目就不記啦,只記值得紀錄的題目。
太難的也不記,等我學會再記==

Arrays & Hashing

LeetCode 49. Group Anagrams

LeetCode 347. Top K Frequent Elements

  • 出現次數 ⇒ Hash Map
  • 只看最大的 個元素 ⇒ Heap

LeetCode 238. Product of Array Except Self

  • 分別使用兩個變數來記錄遇到 0 與沒遇到 0 的乘積

Two Pointers

LeetCode 42. Trapping Rain Water

Stack

LeetCode 22. Generate Parentheses

LeetCode 739. Daily Temperatures

  • Monotonic Stack,找出下一個更大值的 index

LeetCode 84. Largest Rectangle in Histogram

  • 用 Monotonic Stack Iterate 兩次,找出每個元素上下一個更大值

Binary Search

LeetCode 33. Search in Rotated Sorted Array

將陣列切成左右兩份,必定有一部分為有序數列 ⇒ 判斷 target 是否在有序數列中,如果不存在,就往另外一個區間查找,一樣可以分割出有序部分。
notion image

Sliding Window

LeetCode 239. Sliding Window Maximum

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

LeetCode

 
樹形DP 隨筆靠死亡遊戲混飯吃
Loading...
Zixu
Zixu
Welcome to my webstie.
Analytics
Post Count:
224
Latest posts
還好我退了 部隊篇
2025/08/22
泡泡
2025/08/05
還好我退了 新訓篇
2025/08/02
大學畢業心得
2025/07/12
AP325 隨筆
2025/06/07
Lycoris Recoil 莉可麗絲
2025/05/04