Java solution to Problem 3 & correct .gitignore