bricks game hackerrank solution