原创 LintCode 1852: Final Discounted Price (單調棧經典題)

1852. Final Discounted Price A shopkeeper has a sale to complete and has arranged the items being sold in an array. Sta

原创 LintCode 1529: Triplet Subarray With Absolute Diff Less Than or Equal to Limit (同向雙指針經典題)

1529. Triplet Subarray With Absolute Diff Less Than or Equal to Limit Given an increasing array of integers nums and an

原创 LintCode 261: Maximum Connected Area (並查集/BFS好題)

261. Maximum Connected Area Description There is a two-dimensional array, only consists of 00 and 11. You can change a 

原创 LintCode 92: Backpack (經典揹包DP題)

Backpack 中文English Given n items with size Ai, an integer m denotes the size of a backpack. How full you can fill

原创 LintCode 726: Check Full Binary Tree

Check Full Binary Tree A full binary tree is defined as a binary tree in which all nodes have either zero or two

原创 LintCode 56: Two Sum (未排序Two Sum, 雙指針或hashmap)

Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The funct

原创 LintCode 1235: Serialize and Deserialize BST (二叉樹經典題)

Serialize and Deserialize BST Serialization is the process of converting a data structure or object into a sequen

原创 LintCode 630: Knight Shortest Path II (BFS和DP經典題)

Knight Shortest Path II Given a knight in a chessboard n * m (a binary matrix with 0 as empty and 1 as barrier).

原创 LintCode 32: Minimum Window Substring (同向雙指針好題)

Minimum Window Substring 中文English Given two strings source and target. Return the minimum substring of source whi

原创 LintCode 543: Kth Largest in N Arrays (maxHeap經典題)

Kth Largest in N Arrays 中文English Find K-th largest element in N arrays. Example Example 1: Input: k=3, [[9,3,2,4

原创 LintCode 107: Word Break (DFS, DP經典題!)

Word Break Given a string s and a dictionary of words dict, determine if s can be break into a space-separated seq

原创 LintCode 253: Minimum Type Way (雙序列DP好題)

253. Minimum Type Way You are given a string only contains lower or upper English characters that you want to type. At

原创 LintCode 1828: Lake Escape (雙狀態BFS好題)

1828. Lake Escape Description Albert is stranded on a frozen lake. He wants to know if he can make it back to shore. He

原创 LintCode 1293: Count of Range Sum

1293. Count of Range Sum Given an integer array nums, return the number of range sums that lie in [lower, upper] inclus

原创 LintCode 652: Factorization (DFS 搜索經典題)

Factorization 中文English A non-negative numbers can be regarded as product of its factors. Write a function that ta