思路 呼叫API的次數越少越好,因為不確定錯誤會是在前面一點的版本出現,還是後面一點的版本出現,因此最好從中間的版本切入,如果該版本回傳結果為有錯誤的版本,則繼...
Delete Columns to Make Sorted II Medium You are given an array of n strings...
Zigzag Conversion Medium The string "PAYPALISHIRING" is written in...
回顧 & 總結 今天是最後一天了,來回顧一下這些日子分享及學習的內容,雖然是寫LeetCode的題目為主,但在過程中每天的題目是有選過主題的,一天一天都...
今日題目 題目連結:653. Two Sum IV - Input is a BST 題目主題:Hash Table, Two Pointers, Tree,...
原始題目 Given the root of a binary tree, return the sum of all left leaves. Example...
原始題目 Given an array of integers arr, return true if we can partition the array i...
今日題目 題目連結:1. Two Sum 題目主題:Array, Hash Table 簡單說說 Hash Table Hash Table 主要的核心概念是...
原始題目 Assume you are an awesome parent and want to give your children some cookie...
原始題目 Evaluate the value of an arithmetic expression in Reverse Polish Notation....
今日題目 題目連結:53. Maximum Subarray 題目主題:Array, Divide and Conquer, Dynamic Programmi...
今日題目 題目連結:53. Maximum Subarray 題目主題:Array, Divide and Conquer, Dynamic Programmi...
原始題目 Design a stack that supports push, pop, top, and retrieving the minimum ele...
原始題目 You are given a large integer represented as an integer array digits, where...
今日題目 題目連結:605. Can Place Flowers 題目主題:Array, Greedy 昨天介紹了 Greedy 的基本概念,今天會在練習一題以...
因為我對 python 不熟,題目可能會在簡單和中等之間跳來跳去 用 Python3 解 LeetCode 系列,290 Word Pattern,屬於 Eas...
今天直接動手來解題吧!我們從根(root)開始,利用Divide and Conquer來驗證每一個子樹(Subtree),直到我們驗證到最後的葉子。 像是我們...
今日題目 題目連結:1863. Sum of All Subset XOR Totals 題目主題:Array, Backtracking, Bit Manip...
說到廣度優先搜尋我一定要現知道Queue Queue(佇列)是先進來的元素先出去(First In First Out = FIFO)的資料結構,通常用於讓程...
今日題目 題目連結:401. Binary Watch 題目主題:Backtracking, Bit Manipulation 簡單說說 Backtracki...
深度追蹤是刷題前一定要了解的觀念!今天就來用Depth-first-searh的方式來走訪一棵樹吧! 其實從名稱上看起來很直覺,簡單來說就是當我們走了一條路,前...
今日題目 題目連結:1566. Detect Pattern of Length M Repeated K or More Times 題目主題:Array,...
今天一起來認識二元樹的三種遍歷方式吧!但是別急!我們先來認識二元搜尋樹BST的定義! 二元搜尋樹是一棵二元樹,如果不為空(二元樹可以為空!)則須滿足: 左子樹...
今日題目 題目連結:1534. Count Good Triplets 題目主題:Array, Enumeration 分享完Binary Tree等等相關主題...
生活上我們可能有遇過一些二分搜尋的例子。例如以前如果有當過助教的經驗,有時候我們在收學生作業時會作業按照學號由小到大排好,假設有100位學生001~100,我們...
這一題題目會給我們兩個Linked Lists,分別代表兩個非負整數。題目要我們把兩個數相加後回傳一個新的Linked Lists來代表相加後的和。 題目有說,...
今日題目 題目連結:501. Find Mode in Binary Search Tree 題目主題:Tree, Depth-First Search, Bi...
今天直接來看題目的敘述:Given the head of a linked list, remove the nth node from the end of...
今日題目 題目連結:700. Search in a Binary Search Tree 題目主題:Tree, Binary Search Tree, Bin...
本系列文章複習了一些業界常考演算法 從中也一再的複習/整理自己所學,釐清一些概念,希望大家經過一系列的文章,都能有所收穫,再次提醒,建議練習題目時,除了...