comefrom: <gouthampradhan>binary_search_FindPeakElement_1.java
code: public int findPeakElement(int[] nums) {
      if (nums.length == 1) return 0;
      if (nums[0] > nums[1]) return 0;
      else if (nums[nums.length - 1] > nums[nums.length - 2]) return nums.length - 1;
      int l = 0, h = nums.length - 1;
      int ans = 0;
      while (l <= h) {
        int m = l + (h - l) / 2;
        if (m - 1 >= 0 && m + 1 < nums.length) {
          if (nums[m] > nums[m - 1] && nums[m] > nums[m + 1]) {
            return m;
          }
        }
        if (m - 1 >= 0 && nums[m - 1] > nums[m]) { 
          h = m - 1;
        } else {
          ans = l; 
          l = m + 1;
        }
      }
      return ans;
    }
masked: public int sample_funcname ( int [ ] var_0 ) {
    if ( var_0 . length == 1 ) return 0 ;
    if ( var_0 [ 0 ] > var_0 [ 1 ] ) return 0 ;
    else if ( var_0 [ var_0 . length - 1 ] > var_0 [ var_0 . length - 2 ] ) return var_0 . length - 1 ;
    int var_1 = 0 , var_2 = var_0 . length - 1 ;
    int var_3 = 0 ;
    while ( var_1 <= var_2 ) {
      int var_4 = var_1 + ( var_2 - var_1 ) / 2 ;
      if ( var_4 - 1 >= 0 && var_4 + 1 < var_0 . length ) {
        if ( var_0 [ var_4 ] > var_0 [ var_4 - 1 ] && var_0 [ var_4 ] > var_0 [ var_4 + 1 ] ) {
          return var_4 ;
        }
      }
      if ( var_4 - 1 >= 0 && var_0 [ var_4 - 1 ] > var_0 [ var_4 ] ) {
        var_2 = var_4 - 1 ;
      }
      else {
        var_3 = var_1 ;
        var_1 = var_4 + 1 ;
      }
    }
    return var_3 ;
  }
  