leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

LeetCode题解,151道题完整版。广告:推荐刷题网站 https://www.lintcode.com/?utm_source=soulmachine

Results 51 leetcode issues
Sort by recently updated
recently updated
newest added

`Did you notice that the reversed integer might overflow? Assume the input is a 32-bit integer, then the reverse of 1000000003 overflows. How should you handle such cases?` yeah?

Here is my discuss of this probem: https://leetcode.com/discuss/35128/accepted-solution-use-backtracking-bitmask-easy-understand

The recursive version can be accepted on leetcode, but it's not a O(N) solution. Please consider cases from wildcard matching: ``` abbabaaabbabbaababbabbbbbabbbabbbabaaaaababababbbabababaabbababaabbbbbbaaaabababbbaabbbbaabbbbababababbaabbaababaabbbababababbbbaaabbbbbabaaaabbababbbbaababaabbababbbbbababbbabaaaaaaaabbbbbaabaaababaaaabb .*aa.*ba.*a.*bb.*aa.*ab.*a.*aaaaaa.*a.*aaaa.*bba ``` This case never return on my...

In the end of leetcode/C++/chapDFS.tex line263 一个$m$行,$n$列的矩阵,机器人从左上走到右下总共需要的步数是$m+n-2$,其中向下走的步数是$m-1$,因此问题变成了在$m+n-2$个操作中,选择$m–1$个时间点向下走,选择方式有多少种。即 $C_{m+n-2}^{m-1}$ 。 $C_{m+n-2}^{m-1} would present like m - 1 C m + n - 2 But it should be m + n -...

Using function mergeTwoLists will lead to Time limit exceeding. Please use min heap.

Code 2: There isn't any occur variable in this solution. I am confused by what you are talking about.

The problems description is the same as Same Tree =.=

Consider the case: Only root node, whose value is INT_MAX. The code will output false instead of true. Solution: Use LLONG_MAX to replace INT_MAX. class Solution { public: bool isValidBST(TreeNode\*...

Hi, I gotta to run your solution on github. However, I got a TLE when submit to online judge. The corresponding testcase is something like [[1,2],[3,4],[5,6],[7,8],[9,10],[11,12],[13,14],[15,16],[17,18] ... [19999,20000]], [0,20001]] It...

Suppose p is a pointer. The running time for if(p==nullptr) and if(!p) are different in Leetcode. Is this a bug in Leetcode.