Java Imperative Approach
Code\njava []\nclass Solution {\n  public int minimumSum(int[] nums) {\n    int res = Integer.MAX_VALUE;\n\n    for (int i = 0; i < nums.length; i++)\n      for
# Code\n```java []\nclass Solution {\n  public int minimumSum(int[] nums) {\n    int res = Integer.MAX_VALUE;\n\n    for (int i = 0; i < nums.length; i++)\n      for (int j = i + 1; j < nums.length; j++)\n        for (int k = j + 1; k < nums.length; k++)\n          if (nums[i] < nums[j] && nums[k] < nums[j])\n            res = Math.min(res, nums[i] + nums[j] + nums[k]);\n\n    return res == Integer.MAX_VALUE ? -1 : res;\n  }\n}\n```
['Java']