rectangle pattern hackerrank solution in c