Simple Java solution with new signature 1ms
java\nclass Solution {\n    public int[][] insert(int[][] intervals, int[] newInterval) {\n        List<int[]> result = new ArrayList<>();\n        for (int[] i
```java\nclass Solution {\n    public int[][] insert(int[][] intervals, int[] newInterval) {\n        List<int[]> result = new ArrayList<>();\n        for (int[] interval : intervals) {\n\t\t   // If not overlapped, we always add the smaller one to the result and point newInterval to the larger one.\n            if (newInterval[1] < interval[0]) {\n                result.add(newInterval);\n                newInterval = interval;\n            } else if (newInterval[0] > interval[1]) {\n                result.add(interval);\n            } else {\n\t\t\t// If overlapped, update the newInterval\n                newInterval[0] = Math.min(newInterval[0], interval[0]);\n                newInterval[1] = Math.max(newInterval[1], interval[1]);\n            }\n        }\n        result.add(newInterval);\n        return result.toArray(new int[][]{});\n    }\n}\n```
[]