Pattern Program Java Leetcode Problems Two