✅ Python - O(N) - 💯 BEATS 90% - EASY
if you like the solution -- Please vote this code\n\nclass Solution:\n    def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]
**if you like the solution -- Please vote this code**\n```\nclass Solution:\n    def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:\n        ans=[]\n        i=0\n        \n        while i<len(intervals) and newInterval[0]>intervals[i][1]:\n            ans.append(intervals[i])\n            i+=1\n            \n        while i<len(intervals) and intervals[i][0]<=newInterval[1]:\n            newInterval[0]=min(intervals[i][0],newInterval[0])\n            newInterval[1]=max(intervals[i][1],newInterval[1])\n            i+=1\n        ans.append(newInterval)\n        \n        while i<len(intervals):\n            ans.append(intervals[i])\n            i+=1\n        return ans\n```
['Python', 'Python3']