Sort Colors II 原題鏈接: http://lintcode.com/zh-cn/problem/sort-colors-ii/# Given an array of n objec ...
Sort Colors II 原題鏈接: http://lintcode.com/zh-cn/problem/sort-colors-ii/# Given an array of n objec ...
K SUM My Submissions http://www.lintcode.com/en/problem/k-sum/ 題目來自九章算法 13% ...
Minimum Adjustment Cost Given an integer array, adjust each integers so that the difference of e ...
Kth Largest Element Find K-th largest element in an array. Note You can swap elements in t ...
First Bad Version http://lintcode.com/en/problem/first-bad-version The code base version is ...
原題鏈接: binary-tree-preorder-traversal binary-tree-inorder-traversal binary-tree-postorder-tra ...
Fast Power 原題鏈接:http://lintcode.com/en/problem/fast-power/# Calculate the an % b where a, b and n ...
DP. boolean d[i][j]: For the first i items, can we fill a backpack of size j? true or false ...
Subarray Sum 原題鏈接:http://lintcode.com/zh-cn/problem/subarray-sum/# Given an integer array, find a ...
直接+沒什么好說的,關鍵在於不用+的操作: 考驗Bit Operation, 可以用按位^異或兩個操作數對應位以及carry,只是carry是1還是0需要分情況討論。求更優的解法 ...