adding Java solution for number 18