Beautiful Rust solution O(n) - 0 ms
As straightforward as possible.\nAvoided most of heap memory allocation in method.\n\n\n    pub fn insert(intervals: Vec<Vec<i32>>, new_interval: Vec<i32>) -> V
As straightforward as possible.\nAvoided most of heap memory allocation in method.\n\n```\n    pub fn insert(intervals: Vec<Vec<i32>>, new_interval: Vec<i32>) -> Vec<Vec<i32>> {\n        use std::cmp::{min, max};\n        let mut less = vec![];\n        let mut more = vec![];\n        let mut start = new_interval[0];\n        let mut end = new_interval[1];\n        \n        for curr in intervals{\n            if curr[1] < new_interval[0]{\n                less.push(curr);\n            }\n            else if curr[0]>new_interval[1]{\n                more.push(curr);\n            }\n            else {\n                start = min(curr[0], start);\n                end = max(curr[1], end);\n            }\n        }\n        less.push(vec![start, end]);\n        less.append(&mut more);\n        less\n    }\n```
['Rust']