Solved! Leetcode 163. Missing Ranges

source: https://leetcode.com/problems/missing-ranges/description/ Missing Ranges Table of ContentsMissing RangesDescriptionExample 1:Example 2:Constraints:Solution Description You are given an inclusive range [lower, upper] and a sorted unique integer array nums, where all elements are within the inclusive range. A number x is considered missing if x is in the range [lower, upper] and x is not in nums. Return ...

Solved! Leetcode 228. Summary Ranges

source: https://leetcode.com/problems/summary-ranges/description/ Summary Ranges Table of ContentsSummary RangesDescriptionExample 1:Example 2:Constraints:Solution Description You are given a sorted unique integer array nums. A range [a,b] is the set of all integers from a to b (inclusive). Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of ...

Leetcode 57: Insert Interval

https://leetcode.com/problems/insert-interval/description/ You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti. You are also given an interval newInterval = [start, end] that represents the start and end of another interval. Insert newInterval into intervals such that intervals is still sorted in ascending order by starti and intervals still does not have any overlapping ...

ArrayList and Vector

java.util.Vector was introduced with the first version of java development kit (JDK 1.1) and java.util.ArrayList  was introduced in java version 1.2 as a part of collections framework, later vector has also been retrofitted to implement List and became the part of the collections framework. Both ArrayList and Vector use array as a internal data structure and are dynamically resizable with default size zero and ...