随笔分类 - LeetCode题目精选
摘要:Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Return 0 if the array contains less than 2 el
阅读全文
摘要:Given an array of integers arr and an integer d. In one step you can jump from index i to index: i + x where: i + x < arr.length and 0 < x <= d.i - x
阅读全文
摘要:LeetCode中,有很多关于一组interval的问题。大体可分为两类: 1.查看是否有区间重叠; 2.合并重叠区间; 3.插入新的区间; 4. 基于interval的其他问题 【 做题通用的关键步骤】: 1. 按照begin时间排序; 2. 判断两个相邻区间是否重叠: 【假设】 a. 给定的区间
阅读全文
摘要:Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. 来源:力扣(LeetCode)链接:https://leetcode
阅读全文

浙公网安备 33010602011771号