comefrom: <awangdev>Paint Fence_1.java
code: public int numWays(int n, int k) {
          if (n <= 1 || k <= 0) {
              return n * k;
          }
          int[] dp = new int[n + 1];
          dp[0] = 0;
          dp[1] = k;
          dp[2] = k + k * (k - 1); 
          
          for (int i = 3; i <= n; i++) {
              dp[i] = (k - 1) * (dp[i - 1] + dp[i - 2]);
          }
          
          return dp[n];
      }
masked: public int sample_funcname ( int var_0 , int var_1 ) {
    if ( var_0 <= 1 || var_1 <= 0 ) {
      return var_0 * var_1 ;
    }
    int [ ] var_4 = new int [ var_0 + 1 ] ;
    var_4 [ 0 ] = 0 ;
    var_4 [ 1 ] = var_1 ;
    var_4 [ 2 ] = var_1 + var_1 * ( var_1 - 1 ) ;
    for ( int var_7 = 3 ;
    var_7 <= var_0 ;
    var_7 ++ ) {
      var_4 [ var_7 ] = ( var_1 - 1 ) * ( var_4 [ var_7 - 1 ] + var_4 [ var_7 - 2 ] ) ;
    }
    return var_4 [ var_0 ] ;
  }
  