Java Solution Using the sufix, prefix, merging etc
\nclass Solution {\n    public int findLengthOfShortestSubarray(int[] arr) {\n        int n= arr.length;\n        int left = 0;\n        int right = n - 1;\n   
```\nclass Solution {\n    public int findLengthOfShortestSubarray(int[] arr) {\n        int n= arr.length;\n        int left = 0;\n        int right = n - 1;\n        while (left < n-1 && arr[left+1] >= arr[left])\n            left ++;\n        if (left == n - 1)\n            return 0;\n        while (right > 0 && arr[right-1] <= arr[right])\n            right --;\n        int canBeRemoved = Math.min(n-1-left, right);\n        int i = 0;\n        int j = right;\n        while (i <= left && j < n) {\n            if (arr[j] >= arr[i]) {\n                canBeRemoved = Math.min(canBeRemoved, j-1-i);\n                i ++;\n            }\n            else \n                j ++;\n        }\n        return canBeRemoved;\n    }\n}\n```
['Suffix Array', 'Java']