<awangdev>House Robber II_1.java
public int rob(int[] nums) {
        if (nums == null || nums.length == 0) {
            return 0;
        } else if (nums.length == 1) {
            return nums[0];
        }
        int n = nums.length;
        long[][] dp = new long[n + 1][2];
        dp[0][0] = 0; 
        dp[1][0] = 0; 
        dp[1][1] = nums[0]; 
        
        for (int i = 2; i < n; i++) { 
            dp[i][0] = Math.max(dp[i - 1][0], dp[i - 2][0] + nums[i - 1]);
            dp[i][1] = Math.max(dp[i - 1][1], dp[i - 2][1] + nums[i - 1]);
        }
        dp[n][0] = Math.max(dp[n - 1][0], dp[n - 2][0] + nums[n - 1]);
        dp[n][1] = dp[n - 1][1]; 
        
        return (int) Math.max(dp[n][0], dp[n][1]);
    }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 == null || var_0 . length == 0 ) {
    return 0 ;
  }
  else if ( var_0 . length == 1 ) {
    return var_0 [ 0 ] ;
  }
  int var_5 = var_0 . length ;
  long [ ] [ ] var_7 = new long [ var_5 + 1 ] [ 2 ] ;
  var_7 [ 0 ] [ 0 ] = 0 ;
  var_7 [ 1 ] [ 0 ] = 0 ;
  var_7 [ 1 ] [ 1 ] = var_0 [ 0 ] ;
  for ( int var_8 = 2 ;
  var_8 < var_5 ;
  var_8 ++ ) {
    var_7 [ var_8 ] [ 0 ] = Math . max ( var_7 [ var_8 - 1 ] [ 0 ] , var_7 [ var_8 - 2 ] [ 0 ] + var_0 [ var_8 - 1 ] ) ;
    var_7 [ var_8 ] [ 1 ] = Math . max ( var_7 [ var_8 - 1 ] [ 1 ] , var_7 [ var_8 - 2 ] [ 1 ] + var_0 [ var_8 - 1 ] ) ;
  }
  var_7 [ var_5 ] [ 0 ] = Math . max ( var_7 [ var_5 - 1 ] [ 0 ] , var_7 [ var_5 - 2 ] [ 0 ] + var_0 [ var_5 - 1 ] ) ;
  var_7 [ var_5 ] [ 1 ] = var_7 [ var_5 - 1 ] [ 1 ] ;
  return ( int ) Math . max ( var_7 [ var_5 ] [ 0 ] , var_7 [ var_5 ] [ 1 ] ) ;
}
