- 博客(130)
- 收藏
- 关注
原创 关于知识与情景的抽象
这两天阅读了《程序员的思维训练》和《暗时间》两书,其中不约而同地提到了抽象这个概念,也就是说我们在学习的过程中将知识抽象,然后在遇到问题的时候将问题抽象,利用抽象出来的这部分去匹配从而实现大脑中“海量数据”的搜索匹配,很多时候我们没法想到解决问题的方法、没法做到学以致用或者由此及彼可能就是由于对知识的抽象不够,没有发现知识点的核心——表现出来就是死读书,也有可能是对问题的抽象不够,没有发现问题的本...
2019-10-20 14:17:59
367
原创 [LeetCode] (Hard) 685. Redundant Connection II
https://leetcode.com/problems/redundant-connection-ii/In this problem, a rooted tree is adirectedgraph such that, there is exactly one node (the root) for which all other nodes are descendants of...
2019-06-21 15:29:03
207
原创 [LeetCode] (hard) 218. The Skyline Problem
https://leetcode.com/problems/the-skyline-problem/A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you areg...
2019-06-05 16:47:12
190
原创 [LeetCode] (hard) 140. Word Break II
https://leetcode.com/problems/word-break-ii/Given anon-emptystringsand a dictionarywordDictcontaining a list ofnon-emptywords, add spaces insto construct a sentence where each word is a va...
2019-06-03 16:36:46
137
原创 [LeetCode] (hard) 10. Regular Expression Matching && 44. Wildcard Matching
10.Regular Expression MatchingGiven an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero ...
2019-06-02 18:16:10
214
原创 [LeetCode] (medium) 692. Top K Frequent Words
https://leetcode.com/problems/top-k-frequent-words/Given a non-empty list of words, return thekmost frequent elements.Your answer should be sorted by frequency from highest to lowest. If two wo...
2019-05-31 22:30:19
142
原创 [LeetCode] (medium) 688. Knight Probability in Chessboard
https://leetcode.com/problems/knight-probability-in-chessboard/On anNxNchessboard, a knight starts at ther-th row andc-th column and attempts to make exactlyKmoves. The rows and columns are 0...
2019-05-31 22:00:16
156
原创 [LeetCode] (medium) 684. Redundant Connection
https://leetcode.com/problems/redundant-connection/In this problem, a tree is anundirectedgraph that is connected and has no cycles.The given input is a graph that started as a tree with N node...
2019-05-31 13:41:27
249
原创 [LeetCode] (medium) 678. Valid Parenthesis String
https://leetcode.com/problems/valid-parenthesis-string/Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define ...
2019-05-31 12:13:35
140
原创 [LeetCode] (medium) 673. Number of Longest Increasing Subsequence
https://leetcode.com/problems/number-of-longest-increasing-subsequence/Given an unsorted array of integers, find the number of longest increasing subsequence.Example 1:Input: [1,3,5,4,7]Outpu...
2019-05-31 11:17:55
141
原创 [LeetCode] (medium) 672. Bulb Switcher II
https://leetcode.com/problems/bulb-switcher-ii/There is a room withnlights which are turned on initially and 4 buttons on the wall. After performing exactlymunknown operations towards buttons, y...
2019-05-30 17:22:08
146
原创 [LeetCode] (medium) 667. Beautiful Arrangement II
https://leetcode.com/problems/beautiful-arrangement-ii/Given two integersnandk, you need to construct a list which containsndifferent positive integers ranging from1tonand obeys the follow...
2019-05-30 11:51:38
171
原创 [LeetCode] (medium) 659. Split Array into Consecutive Subsequences
https://leetcode.com/problems/split-array-into-consecutive-subsequences/You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subseq...
2019-05-29 12:35:58
117
原创 [LeetCode] (medium) 658. Find K Closest Elements
https://leetcode.com/problems/find-k-closest-elements/Given a sorted array, two integerskandx, find thekclosest elements toxin the array. The result should also be sorted in ascending order. ...
2019-05-29 11:19:11
199
原创 [LeetCode] (medium) 654. Maximum Binary Tree
https://leetcode.com/problems/maximum-binary-tree/Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:The root is the maximum number in the array...
2019-05-28 22:03:23
147
原创 [LeetCode] (medium) 650. 2 Keys Keyboard
https://leetcode.com/problems/2-keys-keyboard/Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step:Copy All: You can copy all the...
2019-05-27 23:29:36
168
原创 [LeetCode] (medium) 611. Valid Triangle Number
https://leetcode.com/problems/valid-triangle-number/Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if w...
2019-05-23 17:14:24
126
原创 [LeetCode] (medium) 593. Valid Square
https://leetcode.com/problems/valid-square/Given the coordinates of four points in 2D space, return whether the four points could construct a square.The coordinate (x,y) of a point is represented...
2019-05-23 16:48:01
213
原创 [LeetCode] (medium) 523. Continuous Subarray Sum
https://leetcode.com/problems/continuous-subarray-sum/Given a list ofnon-negativenumbers and a targetintegerk, write a function to check if the array has a continuous subarray of size at least ...
2019-05-19 22:53:56
215
转载 [LeetCode] (medium) 522. Longest Uncommon Subsequence II
https://leetcode.com/problems/longest-uncommon-subsequence-ii/Given a list of strings, you need to find the longest uncommon subsequence among them. The longest uncommon subsequence is defined as t...
2019-05-19 21:48:40
195
原创 [LeetCode] (medium) 519. Random Flip Matrix
https://leetcode.com/problems/random-flip-matrix/You are given the number of rowsn_rowsand number of columnsn_colsof a2Dbinary matrixwhere all values are initially 0.Write a functionflipw...
2019-05-19 17:56:52
170
原创 [LeetCode] (medium) 516. Longest Palindromic Subsequence
https://leetcode.com/problems/longest-palindromic-subsequence/Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.Example...
2019-05-18 20:30:54
121
原创 [LeetCode] (medium) 494. Target Sum
https://leetcode.com/problems/target-sum/You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols+and-. For each integer, you should choose one fro...
2019-05-16 17:25:44
118
原创 [LeetCode] (medium) 491. Increasing Subsequences
https://leetcode.com/problems/increasing-subsequences/Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increa...
2019-05-16 13:03:52
107
原创 [LeetCode] (medium) 467. Unique Substrings in Wraparound String
https://leetcode.com/problems/unique-substrings-in-wraparound-string/Consider the stringsto be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", soswill look like this: "...zabcde...
2019-05-13 17:49:30
121
原创 [LeetCode] (medium) 464. Can I Win
https://leetcode.com/problems/can-i-win/In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach or excee...
2019-05-13 17:30:18
134
原创 [LeetCode] (medium) 456. 132 Pattern
https://leetcode.com/problems/132-pattern/Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, aksuch thati<j<kand ai< ak< aj. Design an algor...
2019-05-08 20:43:54
126
原创 [LeetCode] (medium) 442. Find All Duplicates in an Array
https://leetcode.com/problems/find-all-duplicates-in-an-array/Given an array of integers, 1 ≤ a[i] ≤n(n= size of array), some elements appeartwiceand others appearonce.Find all the elements...
2019-05-04 01:11:50
100
原创 [LeetCode] (medium) 424. Longest Repeating Character Replacement
https://leetcode.com/problems/longest-repeating-character-replacement/Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at...
2019-05-01 18:13:43
236
原创 [LeetCode] (medium) 421. Maximum XOR of Two Numbers in an Array
https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/Given anon-emptyarray of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai< 231.Find the maximum result of aiXOR aj, where 0 ...
2019-05-01 16:13:42
130
原创 [LeetCode] (medium) 416. Partition Equal Subset Sum
https://leetcode.com/problems/partition-equal-subset-sum/Given anon-emptyarray containingonly positive integers, find if the array can be partitioned into two subsets such that the sum of elemen...
2019-04-30 12:27:24
301
原创 [LeetCode] (medium) 406. Queue Reconstruction by Height
https://leetcode.com/problems/queue-reconstruction-by-height/Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers(h, k), wherehis the heig...
2019-04-29 20:18:22
133
原创 [LeetCode] (medium) 402. Remove K Digits
https://leetcode.com/problems/remove-k-digits/Given a non-negative integernumrepresented as a string, removekdigits from the number so that the new number is the smallest possible.Note:The ...
2019-04-29 17:32:28
142
翻译 [LeetCode] (medium) 398. Random Pick Index
https://leetcode.com/problems/random-pick-index/Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number ...
2019-04-26 19:31:00
161
原创 [LeetCode] (medium) 397. Integer Replacement
https://leetcode.com/problems/integer-replacement/Given a positive integernand you can do operations as follow:Ifnis even, replacenwithn/2. Ifnis odd, you can replacenwith eithern...
2019-04-26 18:46:08
117
原创 [LeetCode] (medium) 390. Elimination Game
https://leetcode.com/problems/elimination-game/There is a list of sorted integers from 1 ton. Starting from left to right, remove the first number and every other number afterward until you reach ...
2019-04-25 10:25:15
101
原创 [LeetCode] (medium) 385. Mini Parser
https://leetcode.com/problems/mini-parser/Given a nested list of integers represented as a string, implement a parser to deserialize it.Each element is either an integer, or a list -- whose eleme...
2019-04-23 19:20:23
106
原创 [LeetCode] (medium) 376. Wiggle Subsequence
https://leetcode.com/problems/wiggle-subsequence/A sequence of numbers is called awiggle sequenceif the differences between successive numbers strictly alternate between positive and negative. Th...
2019-04-07 23:49:26
123
原创 [LeetCode] (medium) 375. Guess Number Higher or Lower II
We are playing the Guess Game. The game is as follows:I pick a number from1ton. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number I picked is...
2019-04-07 00:33:43
133
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人