5 kyu

One Line Task: Diamond Creator Pro

52 of 140MercQueen

Description:

Relations :

The following challenge is partially related to two already existing Kata's. But is differnt in the sense that neither approach will work here and this is a more performance version as well. Links :

number1 , number2. OK last one maybe not.


Challenge :

You are given an integer n as input. Your job is to create a diamond that is 2x the given number n.


Input :

Input is integer n and n > 2 ≤ 3000.


Output :

Output will be a string and it will be in form of a diamond consisting of + with an addition line at the start showing n using +


Examples :

D(3) :

+++
  +
 +++
+++++
+++++
 +++
  +
  
D(5) :

+++++
    +
   +++
  +++++
 +++++++
+++++++++
+++++++++
 +++++++
  +++++
   +++
    +

Restrictions :

This is code-golf so there is a limit.

Javascript solutions are limited to less than 111 characters.

Python solution are limited to less than 89 characters

Ruby solution are limited to less than 82 characters

All limits are exlusive

Strings
Arrays
Mathematics
Puzzles
Restricted

More By Author:

Check out these other kata created by MercQueen

Stats:

CreatedApr 19, 2018
PublishedApr 19, 2018
Warriors Trained677
Total Skips19
Total Code Submissions2249
Total Times Completed140
JavaScript Completions52
Python Completions86
Ruby Completions16
Total Stars26
% of votes with a positive feedback rating94% of 54
Total "Very Satisfied" Votes49
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes1
Total Rank Assessments6
Average Assessed Rank
5 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • MercQueen Avatar
  • zruF Avatar
  • kazk Avatar
  • Firefly2002 Avatar
  • FArekkusu Avatar
Ad