House Robber You are a professional robber planning to rob houses along a street...
Climbing Stairs You are climbing a staircase. It takes n steps to reach the top....
Dynamic Programming 策略簡介 Dynamic Programming(動態規劃) 是一種解決問題的策略。 Dynamic Programmi...
Alien Dictionary There is a new alien language which uses the latin alphabet. Ho...
Course Schedule There are a total of numCourses courses you have to take, labele...
Number of Connected Components in an Undirected Graph Given n nodes labeled from...
Graph Valid Tree Given n nodes labeled from 0 to n - 1 and a list of undirected ...
Number of Islands Given an m x n 2D binary grid grid which represents a map of '...
Clone Graph Given a reference of a node in a connected undirected graph. Return...
Pacific Atlantic Water Flow There is an m x n rectangular island that borders bo...
Graph 資料結構解析 Graph(圖) 是種用來表達資料間關係的資料結構。 Graph(圖) 所組成的要件有: 節點(vertex): 這是圖中存放資料的...
Word Search Given an m x n grid of characters board and a string word, return tr...
Combination Sum Given an array of distinct integers candidates and a target inte...
BackTracking 演算法簡介 BackTracking(回溯法) 是窮舉法的一種。 其概念是先逐步列舉出所有可能,然後逐步排查不可能的部份。 當遇到不可...
Find Median from Data Stream The median is the middle value in an ordered intege...
Heap 資料結構簡介 Heap 是一種特別的完全二元樹。樹中的任意節點值與其子代節點值具有一定大小順序關係,這個特性稱作 Heap Property。 其中,...
Word Search II Given an m x n board of characters and a list of strings words, r...
Design Add and Search Words Data Structure Design a data structure that supports...
Implement Trie (Prefix Tree) A trie (pronounced as "try") or prefix tr...
Trie 資料結構簡介 Trie 是一種特殊的 Tree,稱為字首樹。是一種有序樹,是種多元搜尋樹。 不同於二元搜尋樹,鍵值是根據節點所走過的路徑形成。每個節點...
Serialize and Deserialize Binary Tree Serialization is the process of converting...
Binary Tree Maximum Path Sum A path in a binary tree is a sequence of nodes wher...
Construct Binary Tree from Pre-order and In-order Traversal Given two integer ar...
Binary Tree Level Order Traversal Given the rootof a binary tree, return the lev...
Validate Binary Search Tree Given the root of a binary tree, determine if it is...
Kth Smallest Element in a BST Given the root of a binary search tree, and an int...
Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST),...
Maximum Depth of Binary Tree Given the root of a binary tree, return its maximum...
Invert Binary Tree Given the root of a binary tree, invert the tree, and return ...
Subtree of Another Tree Given the roots of two binary trees root and subRoot, re...