Shortest solution is the one that is correct for all input test cases, but has the smallest number of non blank characters.

For e.g.

`public class PowerOfThree {`

public int nthElement(int N) {

int power = 1;

int sum = 0;

for (int i = 0; i < 31; ++i) {

if ((N & (1<<i)) == (1<<i)) {

sum += power;

}

power *= 3;

}

return sum;

}

}

has 148 non blank characters.

The winner is the one who has the smallest number of characters and the solution passes on ALL test cases.

In case of two solutions with the same number of characters, the winner is the one who has submitted earlier.

Post your solutions of the problem 500 here.

Be sure to test the solution in the Practice room first.

The contest is active until May 10th 12:00 (noon), and the winner will receive the new

**CodeFu T-Shirt.**