Successfuly completed solution 3. Could optimize speed and get rid of the use of bigdecimal...