Java + Easy to understand + O(N) + Code with comments
\nclass Solution {\n    public int[][] insert(int[][] intervals, int[] newInterval) {\n        \n        List<int[]> result = new ArrayList<>();\n        \n    
```\nclass Solution {\n    public int[][] insert(int[][] intervals, int[] newInterval) {\n        \n        List<int[]> result = new ArrayList<>();\n        \n        // Handling edge case when intervals is empty\n        if(intervals.length == 0){\n            if(newInterval.length != 0)\n                result.add(newInterval);\n            return result.toArray(new int[result.size()][]);\n        }\n        \n        int i=0;\n        \n        // 1. Copy until overlap is not found\n        while(i < intervals.length && newInterval[0] > intervals[i][1])\n            result.add(intervals[i++]);\n        \n        // 2. Update newInterval by comparing it with overlapped intervals\n        while(i < intervals.length && newInterval[1] >= intervals[i][0]){\n            newInterval[0] = Math.min(newInterval[0], intervals[i][0]);\n            newInterval[1] = Math.max(newInterval[1], intervals[i][1]);\n            i++;\n        }\n        \n        // 3. Add the updated newInterval\n        result.add(newInterval);\n        \n        // 4. Copy the remaining in the intervals list to the final result\n        while(i < intervals.length)\n            result.add(intervals[i++]);\n        \n        return result.toArray(new int[result.size()][]);\n    }\n}\n```
['Java']