✅ Simple Java Solution
CODE\nJava []\npublic int getLargestOutlier(int[] nums) {\n\tArrays.sort(nums);\n\tint sum = 0;\n\tfor(int num : nums) {\n\t\tsum += num;\n\t}\n\n\tint n = nums
## **CODE**\n```Java []\npublic int getLargestOutlier(int[] nums) {\n\tArrays.sort(nums);\n\tint sum = 0;\n\tfor(int num : nums) {\n\t\tsum += num;\n\t}\n\n\tint n = nums.length;\n\tfor(int i=0; i<n; i++) {\n\t\tint remained = sum-nums[i];\n\t\tint find = remained-nums[i];\n\t\tint findIdx = Arrays.binarySearch(nums, find);\n\t\tif(findIdx > -1) {\n\t\t\tboolean flag = false;\n\t\t\tif(findIdx != i) {\n\t\t\t\tflag = true;\n\t\t\t} else if(findIdx == i && ((findIdx>0 && nums[findIdx-1] == find) || (findIdx<n-1 && nums[findIdx+1] == find))) {\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t\tif(flag) return find;\n\t\t}\n\t}\n\treturn -1;\n}\n```
['Java']