Print a Diamond Matrix x
numbers deep, x
will always be greater than 0 and less than 10.
Examples:
(4) =>
1
121
12321
1234321
12321
121
1
(9) =>
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
123456787654321
1234567654321
12345654321
123454321
1234321
12321
121
1
(1) => 1
*^You can assume that you will always recieved valid input
Golfing in Lisp-like languages is not a particularly good idea with all these parentheses. :-D Anyway, there are only two solutions...
It's a pity,
join
has to be referenced explicitly from clojure.string. It could otherwise be used instead of(apply str ..)
. I'm curious if it can be golfed any further.Language: Clojure
Length: 150 (excluding newline)
Solution: