Tianze Wang

Results 5 issues of Tianze Wang

++inc may be better, although inc++ could AC.

Line 16: return total>=0 ? j+1 : -1 Should be (j+1)%gas.size(), so that we will return 0 instead of N in some cases.

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\*...

Time limit exceeded. linear solution: https://oj.leetcode.com/discuss/20176/concise-in-place-solution-with-linear-time Binary search: https://oj.leetcode.com/discuss/19000/c-my-binary-search-solution