C# beats 100 % time & space
\npublic class Solution {\n    public int FindLengthOfShortestSubarray(int[] arr) {\n        \n       if(arr == null || arr.Length == 0)\n       {\n           r
```\npublic class Solution {\n    public int FindLengthOfShortestSubarray(int[] arr) {\n        \n       if(arr == null || arr.Length == 0)\n       {\n           return 0;\n       }\n        \n       int n = arr.Length;\n       int st = 0;\n       int end = n-1;\n        \n       while(st < n - 1 && arr[st] <= arr[st+1])\n           st++;\n        \n       // check if array is sorted\n       if(st == n - 1)\n       {           \n           return 0;\n       }\n        \n       while(end > 0 && arr[end] >= arr[end - 1])\n           end--;\n        \n       Console.WriteLine(st);\n       Console.WriteLine(end);\n       int min = end;\n       for(int i = 0; i <= st; i++)\n       {\n           while(end < n && arr[i] > arr[end] )\n           {\n               end++;\n           }\n           \n           min = Math.Min(min, (end - i - 1));\n           \n       }\n        \n       return min;\n        \n    }\n}\n```
[]