comefrom: <awangdev>Ugly Number II_3.java
code: public int nthUglyNumber(int n) {
          if (n <= 0) {
          	return 0;
          } else if (n == 1) {
          	return 1;
          }
          long[] dp = new long[n + 1];
          dp[0] = 0;
          dp[1] = 1;
  
          PriorityQueue<Long> candidate = new PriorityQueue<Long>();
  		HashSet<Long> set = new HashSet<Long>();
  		set.add(dp[1]);
  		for (int i = 2; i <= n; i++) {
  			if (!set.contains(dp[i - 1] * 2)) {
  				candidate.add(dp[i - 1] * 2);
  				set.add(dp[i - 1] * 2);
  			}
  			if (!set.contains(dp[i - 1] * 3)) {
  				candidate.add(dp[i - 1] * 3);
  				set.add(dp[i - 1] * 3);
  			}
  			if (!set.contains(dp[i - 1] * 5)) {
  				candidate.add(dp[i - 1] * 5);
  				set.add(dp[i - 1] * 5);
  			}
  			dp[i] = candidate.poll();
  		}
  
  		return (int)dp[n];
      }
masked: public int sample_funcname ( int var_0 ) {
    if ( var_0 <= 0 ) {
      return 0 ;
    }
    else if ( var_0 == 1 ) {
      return 1 ;
    }
    long [ ] var_1 = new long [ var_0 + 1 ] ;
    var_1 [ 0 ] = 0 ;
    var_1 [ 1 ] = 1 ;
    PriorityQueue < Long > var_2 = new PriorityQueue < Long > ( ) ;
    HashSet < Long > var_3 = new HashSet < Long > ( ) ;
    var_3 . add ( var_1 [ 1 ] ) ;
    for ( int var_4 = 2 ;
    var_4 <= var_0 ;
    var_4 ++ ) {
      if ( ! var_3 . contains ( var_1 [ var_4 - 1 ] * 2 ) ) {
        var_2 . add ( var_1 [ var_4 - 1 ] * 2 ) ;
        var_3 . add ( var_1 [ var_4 - 1 ] * 2 ) ;
      }
      if ( ! var_3 . contains ( var_1 [ var_4 - 1 ] * 3 ) ) {
        var_2 . add ( var_1 [ var_4 - 1 ] * 3 ) ;
        var_3 . add ( var_1 [ var_4 - 1 ] * 3 ) ;
      }
      if ( ! var_3 . contains ( var_1 [ var_4 - 1 ] * 5 ) ) {
        var_2 . add ( var_1 [ var_4 - 1 ] * 5 ) ;
        var_3 . add ( var_1 [ var_4 - 1 ] * 5 ) ;
      }
      var_1 [ var_4 ] = var_2 . poll ( ) ;
    }
    return ( int ) var_1 [ var_0 ] ;
  }
  