Added beginner solution - Java