原创 Leetcode 124 Binary Tree Maximum Path Sum 二叉樹最大路徑和

原題鏈接 https://leetcode.com/problems/binary-tree-maximum-path-sum/ 題目描述 Given a binary tree, find the maximum path su

原创 Leetcode 188 Best Time to Buy and Sell Stock IV 至多k次買賣股票最大收益

原題地址 https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/ 題目描述 Say you have an array for which the ith

原创 Leetcode 130 Surrounded Regions

原題地址 https://leetcode.com/problems/surrounded-regions/ 題目描述 Given a 2D board containing ‘X’ and ‘O’, capture all re

原创 Leetcode 166 Fraction to Recurring Decimal 分數化小數

原題地址 https://leetcode.com/problems/fraction-to-recurring-decimal/ 題目描述 Given two integers representing the numerato

原创 Leetcode 148 Sort List 單鏈表排序

原題鏈接 https://leetcode.com/problems/sort-list/ 題目描述 Sort a linked list in O(nlogn) time using constant space complex

原创 Leetcode 173 Binary Search Tree Iterator 二叉查找樹迭代器

原題地址 https://leetcode.com/problems/binary-search-tree-iterator/ 題目描述 Implement an iterator over a binary search tre

原创 Leetcode 179 Largest Number 構造最大數字

原題地址 https://leetcode.com/problems/largest-number/ 題目描述 Given a list of non negative integers, arrange them such th

原创 Leetcode 162 Find Peak Element 查找峯值元素(極大值)

原題地址 https://leetcode.com/problems/find-peak-element/ 題目描述 A peak element is an element that is greater than its ne

原创 Leetcode 152 Maximum Product Subarray 子數組最大乘積

原題地址 https://leetcode.com/problems/maximum-product-subarray/ 題目描述 Find the contiguous subarray within an array (con

原创 Leetcode 200 Number of Islands 島的個數

原題地址 https://leetcode.com/problems/number-of-islands/ 題目描述 Given a 2d grid map of ‘1’s (land) and ‘0’s (water), cou

原创 Leetcode 199 Binary Tree Right Side View 二叉樹右視圖

原題地址 https://leetcode.com/problems/binary-tree-right-side-view/ 題目描述 Given a binary tree, imagine yourself standing

原创 Leetcode 150 Evaluate Reverse Polish Notation 反向波蘭表示法求值

原題地址 https://leetcode.com/problems/evaluate-reverse-polish-notation/ 題目描述 Evaluate the value of an arithmetic expre

原创 Leetcode 151 Reverse Words in a String

原題地址 https://leetcode.com/problems/reverse-words-in-a-string/ 題目描述 Given an input string, reverse the string word b

原创 Leetcode 131 Palindrome Partitioning 迴文分割

原題地址 https://leetcode.com/problems/palindrome-partitioning/ 題目描述 Given a string s, partition s such that every subs

原创 Leetcode 208 Implement Trie (Prefix Tree) 實現字典樹 (前綴字典樹)

原題地址 https://leetcode.com/problems/implement-trie-prefix-tree/ 題目描述 Implement a trie with insert, search, and start