rectangle pattern hackerrank solution