JAVA || EXPLAINED SOLUTION
\n/*\nInterval will not be overlapped\ncase 1 : when interval[end] < newInterval[start],ex-newInterval = [4,8], interval = [1,2]\ncase 2 : when interval[start] 
```\n/*\nInterval will not be overlapped\ncase 1 : when interval[end] < newInterval[start],ex-newInterval = [4,8], interval = [1,2]\ncase 2 : when interval[start] > newInterval[end],ex-newInterval = [4,8], interval = [12,16]\ncase 3 : when new interval is already added in output list\n\nremaining all cases they will be overlapped\n*/\n\nclass Solution {\n    public int[][] insert(int[][] intervals, int[] newInterval) {\n        \n        List<int[]> res = new ArrayList<>();\n        for(int[] interval: intervals){\n            // case3 and case1\n            if(newInterval==null || interval[1]<newInterval[0]){\n                res.add(interval);\n            }else if(interval[0]>newInterval[1]){ // case 2\n                res.add(newInterval);\n                res.add(interval);\n                newInterval = null;\n            }else{ // overlapping\n                newInterval[0] = Math.min(newInterval[0], interval[0]);\n                newInterval[1] = Math.max(newInterval[1], interval[1]);\n            }\n        }\n        if(newInterval!=null) res.add(newInterval);\n        return res.toArray(new int[res.size()][]);\n    }\n}\n```
['Java']