✅ Simple Java Solution
CODE\nJava []\npublic int findLengthOfShortestSubarray(int[] arr) {\n\tint n = arr.length, i = 1;\n\twhile(i<n && arr[i-1] <= arr[i]) i++;\n\tif(i == n) return 
## **CODE**\n```Java []\npublic int findLengthOfShortestSubarray(int[] arr) {\n\tint n = arr.length, i = 1;\n\twhile(i<n && arr[i-1] <= arr[i]) i++;\n\tif(i == n) return 0;\n\n\tint leftSorted = i-1;\n\ti = n-2;\n\twhile(i>=0 && arr[i] <= arr[i+1]) i--;\n\n\tint rightSorted = i+1, res = Math.max(leftSorted+1, n-rightSorted);\n\tfor(i=0; i<=leftSorted; i++) {\n\t\tint l = rightSorted, r = n-1, j = n;\n\t\twhile(l <= r) {\n\t\t\tint mid = l + (r-l)/2;\n\t\t\tif(arr[i] <= arr[mid]) {\n\t\t\t\tj = mid;\n\t\t\t\tr = mid-1;\n\t\t\t} else {\n\t\t\t\tl = mid+1;\n\t\t\t}\n\t\t}\n\n\t\tres = Math.max(res, i+1+n-j);\n\t}\n\n\treturn n-res;\n}\n```
['Binary Tree', 'Java']