MinimumSumOfMountainTriplets Java version
IntuitionTriplets, so we should have 3 nested loopApproachIn three nested loop, just followed the conditions of the taskComplexity

Time complexity:
O(N^3)


Sp
# Intuition
Triplets, so we should have 3 nested loop

# Approach
In three nested loop, just followed the conditions of the task

# Complexity
- Time complexity:
O(N^3)

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int minimumSum(int[] nums) {
        int max = 151;
    	int currentMin = max;    	
    	for (int i = 0; i < nums.length; i++) {
			for (int j = i + 1; j < nums.length; j++) {
				for (int k = j + 1; k < nums.length; k++) {
					if((nums[i] < nums[j]) && (nums[k] < nums[j])) {
						int sum = nums[i] + nums[j] + nums[k];
						if (sum < currentMin) currentMin = sum;
					}
				}
			}
		}
    	return currentMin < max ? currentMin : -1;
    }
}
```
['Java']