摘要:
665. Non-decreasing Array Input: [4,2,3] Output: True Explanation: You could modify the first 4 to 1 to get a non-decreasing array.递增 思路:贪心思想,找异常值,存在两 阅读全文
摘要:
563. Binary Tree Tilt 566. Reshape the Matrix 572. Subtree of Another Tree 581. Shortest Unsorted Continuous Subarray 594. Longest Harmonious Subseque 阅读全文
摘要:
492. Construct the Rectangle Input: 4 Output: [2, 2] Explanation: The target area is 4, and all the possible ways to construct it are [1,4], [2,2], [4 阅读全文
摘要:
448. Find All Numbers Disappeared in an Array 思路:把数组的内容和index进行一一对应映射,映射规则是取反,由此可知,重复出现两次的数字会变为正,出现一次的为负。 需要注意的是,如果不能增加额外空间的话,要在本数组上面进行映射,这时候就需要内容-1=i 阅读全文
摘要:
53. Maximum Subarray Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return i 阅读全文