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