Hard Related Topics: Math / StringLeetCode Source 解題想法 在這個問題中,給定一個代表整數的字串 n,我們...
MediumRelated Topics: Math / String / SimulationLeetCode Source 解題想法 首先我們要定義分子...
You are visiting a farm that has a single row of fruit trees arranged from left...
EasyRelated Topics: Bit ManipulationLeetCode Source 解題想法 十進位數字轉成二進制 之後將1轉成0 將0...
HardRelated Topics: String / Dynamic ProgrammingLeetCode Source 解題想法 這道題目是關於計算...
MediumRelated Topics: Array / Math / Dynamic Programming / Prefix Sum / Game Th...
MediumRelated Topics: Math / Dynamic ProgrammingLeetCode Source 解題想法 題目要求我們找到最...
MediumRelated Topics: Hash Table / Math / Dynamic Programming / Heap (Priority...
MediumRelated Topics: Array / Dynamic ProgrammingLeetCode Source 解題想法 暴力解的話,會使...
MediumRelated Topics: Array / GreedyLeetCode Source 解題想法 題目唯一要注意的點就是 arrays 最大...
EasyRelated Topics: Array / GreedyLeetCode Source 解題想法 題目主要是希望透過 5 10 20 來交易價值...
HardRelated Topics: Array / Two Pointers / Binary Search / SortingLeetCode Sour...
MediumRelated Topics: Array / BacktrackingLeetCode Source 解題想法 首先透過 sort 把 can...
EasyRelated Topics: Tree / Design / BST / Heap (Priority Queue) / BT / Data Str...
HardRelated Topics: Array / DFS / BFS / Matrix / Strongly Connected ComponentLe...
MediumRelated Topics: Array / Hash Table / DFS / BFS / Union Find MatrixLeetCod...
MediumRelated Topics: Array / Hash Table / Math / MatrixLeetCode Source 解題想法 整...
MediumRelated Topics: Array / Matrix / SimulationLeetCode Source 解題想法 首先設定每次尋訪...
HardRelated Topics: Hash Table / String / Greedy / Sorting / CountingLeetCode S...
MediumRelated Topics: Hash Table / String / Greedy / Sorting / CountingLeetCode...
EasyRelated Topics: Array / Hash Table / String / CountingLeetCode Source 解題想法...
MediumRelated Topics: Array / Two Pointers / Binary Search / SortingLeetCode So...
EasyRelated Topics: Array / Hash Table / SortingLeetCode Source 解題想法 基本上就是判斷說兩...
MediumRelated Topics: Array / Sliding WindowLeetCode Source 解題想法 我們首先遍歷數組來計算1的...
EasyRelated Topics: Array / StringLeetCode Source 解題想法 在 details 的陣列中,總長 15,計算...
前言 最近在刷 LeetCode,今天要來跟大家分享一下我解「383. Ransom Note」的過程!這題雖然標示為 Easy,解題邏輯不難,但因為對語法不熟...
Stone Game 題目連結 兩種情況 大數字在前或後==> alice 可以先選 大數字在中間 ==> 由於alice 選數字時數量一定是...
Smallest String Starting From Leaf 題目連結 用bfs來做 1.先移路往左走(直到左邊是null),刪掉當下的點(往回走)...
Add One Row to Tree (623) 在原本的二元樹的某一層插入新節點(後面一樣是舊節點) 用bfs遍歷樹(直到到要補的層前),插入左值與右值...
[LeetCode] 875 - Koko Eating Bananas Problem 給定一個有 n 堆香蕉的陣列 piles (第 i 堆的數量為 pil...