Hackerrank Java Bigdecimal Solution