Easy C++ solution using binary search
\nclass Solution {\npublic:\n    int findLengthOfShortestSubarray(vector<int>& arr) {\n        // if there is one element, there is no need of removal\n        
```\nclass Solution {\npublic:\n    int findLengthOfShortestSubarray(vector<int>& arr) {\n        // if there is one element, there is no need of removal\n        if(arr.size()==1) {\n            return 0;\n        }\n        // \'left\' deontes ending index of the largest non-decreasing subarray starting from 0th index \n        // \'right\' denotes the starting index of the largest non-decreasing subarray ending at the last index \n        // \'len\' would be our answer\n        int left=0,right=arr.size()-1,len=INT_MAX;\n        \n        // find out \'left\'\n        while(left+1<arr.size() && arr[left]<=arr[left+1]) {\n            left++;\n        }\n        \n        // find out \'right\'\n        while(right>0 && arr[right]>=arr[right-1]) {\n            right--;\n        }\n        \n        // if the array is already sorted , there is no need of removal\n        if(left>right) {\n            return 0;\n        }\n        \n        // if the last element of prefix is smaller than first element of suffix then their intermediate portion must be removed to make it sorted\n        // so removed part is the middle portion of left and right\n        else if(arr[left]<=arr[right]) {\n            return right-left-1;\n        }\n        \n        // if the last element of prefix >= first element of suffix then for every element of prefix we have to find an element in suffix, not less than the prefix element\n        for(int i=left;i>=0;i--) {\n            int index=lower_bound(arr.begin()+right,arr.end(),arr[i])-arr.begin();\n            // \'index\' is the index in suffix of the element which is not less than arr[i]\n            // so we can remove the part between \'index\' and \'i\'\n            // mathematically we have to remove (index,i)\n            len=min(len,index-i-1);\n        }\n        \n        // we also have to find an element in prefix for every suffix element which is not less than the suffix element\n        for(int i=right;i<arr.size();i++) {\n            int index=lower_bound(arr.begin(),arr.begin()+left,arr[i])-arr.begin();\n            // \'index\' is the index in prefix of the element which is not less than arr[i]\n            // mathematically we have to remove [index,i)\n            len=min(len,i-index);\n        }\n        \n        // finally return the answer\n        return len;\n    }\n};\n```\n***Please upvote if you have got any help from my code. Thank you.***
['Binary Search', 'C']