<awangdev>Longest Consecutive Sequence_2.java
public int longestConsecutive(int[] num) {
        if (num == null || num.length == 0) {
            return 0;
        }
        int maxL = 1;
        HashMap<Integer, Boolean> history = new HashMap<Integer, Boolean>();
        for (int i : num) {
            history.put(i, false);
        }
        for (int i : num) {
            if (history.get(i)) {
                continue;
            }
            int temp = i;
            int total = 1;
            while (history.containsKey(temp + 1)) {
                total++;
                temp++;
                history.put(temp, true);
            }
            temp = i;
            while (history.containsKey(temp - 1)) {
                total++;
                temp--;
                history.put(temp, true);
            }
            maxL = Math.max(maxL, total);
        }
        return maxL;
    }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 == null || var_0 . length == 0 ) {
    return 0 ;
  }
  int var_5 = 1 ;
  HashMap < Integer , Boolean > var_9 = new HashMap < Integer , Boolean > ( ) ;
  for ( int var_10 : var_0 ) {
    var_9 . put ( var_10 , false ) ;
  }
  for ( int var_10 : var_0 ) {
    if ( var_9 . get ( var_10 ) ) {
      continue ;
    }
    int var_13 = var_10 ;
    int var_14 = 1 ;
    while ( var_9 . containsKey ( var_13 + 1 ) ) {
      var_14 ++ ;
      var_13 ++ ;
      var_9 . put ( var_13 , true ) ;
    }
    var_13 = var_10 ;
    while ( var_9 . containsKey ( var_13 - 1 ) ) {
      var_14 ++ ;
      var_13 -- ;
      var_9 . put ( var_13 , true ) ;
    }
    var_5 = Math . max ( var_5 , var_14 ) ;
  }
  return var_5 ;
}
