Just a runnable solution
Code\n\nimpl Solution {\n    pub fn find_length_of_shortest_subarray(arr: Vec<i32>) -> i32 {\n        let n = arr.len();\n        let mut left = 0;\n        whi
# Code\n```\nimpl Solution {\n    pub fn find_length_of_shortest_subarray(arr: Vec<i32>) -> i32 {\n        let n = arr.len();\n        let mut left = 0;\n        while left + 1 < n && arr[left] <= arr[left + 1] {\n            left += 1;\n        }\n        if left == n - 1 {\n            return 0;\n        }\n        let mut right = n - 1;\n        while right > 0 && arr[right - 1] <= arr[right] {\n            right -= 1;\n        }\n        let mut res = (n - left - 1).min(right) as i32;\n        let mut i = 0;\n        let mut j = right;\n        while i <= left && j < n {\n            if arr[i] <= arr[j] {\n                res = res.min((j - i - 1) as i32);\n                i += 1;\n            } else {\n                j += 1;\n            }\n        }\n        res\n    }\n}\n```
['Rust']