<qiyuangong>697_Degree_of_an_Array_1.java
public int findShortestSubArray(int[] nums) {
        Map<Integer, Integer> left = new HashMap(),
            right = new HashMap(), count = new HashMap();

        for (int i = 0; i < nums.length; i++) {
            int x = nums[i];
            if (left.get(x) == null) left.put(x, i);
            right.put(x, i);
            count.put(x, count.getOrDefault(x, 0) + 1);
        }

        int ans = nums.length;
        int degree = Collections.max(count.values());
        for (int x: count.keySet()) {
            if (count.get(x) == degree) {
                ans = Math.min(ans, right.get(x) - left.get(x) + 1);
            }
        }
        return ans;
    }
public int sample_funcname ( int [ ] var_0 ) {
  Map < Integer , Integer > var_4 = new HashMap ( ) , var_5 = new HashMap ( ) , var_6 = new HashMap ( ) ;
  for ( int var_8 = 0 ;
  var_8 < var_0 . length ;
  var_8 ++ ) {
    int var_10 = var_0 [ var_8 ] ;
    if ( var_4 . get ( var_10 ) == null ) var_4 . put ( var_10 , var_8 ) ;
    var_5 . put ( var_10 , var_8 ) ;
    var_6 . put ( var_10 , var_6 . getOrDefault ( var_10 , 0 ) + 1 ) ;
  }
  int var_16 = var_0 . length ;
  int var_20 = Collections . max ( var_6 . values ( ) ) ;
  for ( int var_10 : var_6 . keySet ( ) ) {
    if ( var_6 . get ( var_10 ) == var_20 ) {
      var_16 = Math . min ( var_16 , var_5 . get ( var_10 ) - var_4 . get ( var_10 ) + 1 ) ;
    }
  }
  return var_16 ;
}
