Finished Java solution for 146 - Accepted