1 line
1.1 KiB
Plaintext
1 line
1.1 KiB
Plaintext
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Merge Intervals(56).ipynb","provenance":[],"authorship_tag":"ABX9TyPLNkDlxD68AxVO2CjjAmsW"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["# 56. Merge Intervals\n","Medium\n","\n","Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.\n"," \n","Example 1:\n","Input: intervals = [[1,3],[2,6],[8,10],[15,18]]\n","Output: [[1,6],[8,10],[15,18]]\n","Explanation: Since intervals [1,3] and [2,6] overlap, merge them into [1,6].\n","\n","Example 2:\n","Input: intervals = [[1,4],[4,5]]\n","Output: [[1,5]]\n","Explanation: Intervals [1,4] and [4,5] are considered overlapping.\n","\n"," \n","Constraints:\n","1 <= intervals.length <= 104\n","intervals[i].length == 2\n","0 <= starti <= endi <= 104\n"],"metadata":{"id":"RVkPngGz960v"}},{"cell_type":"code","execution_count":null,"metadata":{"id":"UGH7xlpb95bU"},"outputs":[],"source":[""]}]} |