1class Solution {2public boolean validMountainArray(int[] arr) {3// edge case4if (arr.length < 3) return false;5// keep 2 pointers6int i = 0;7int j = arr.length - 1;8// use i pointer to iterate through steep increase from LHS9while (i < j && arr[i] < arr[i + 1]) {10i++;11}12// use j pointer to iterate steep increase from RHS13while (j > i && arr[j] < arr[j - 1]) {14j--;15}16// both should meet at same place and it be neither start or end.17return i == j && i < arr.length - 1 && j > 0;18}19}