7 kyu
Complete The Pattern #5 - Even Ladder
687 of 1,818DivyanshBatham
Description:
Task:
You have to write a function pattern which creates the following pattern up to n/2
number of lines.
- If
n <= 1
then it should return""
(i.e. empty string). - If any odd number is passed as argument then the pattern should last up to the largest even number which is smaller than the passed odd number.
Examples:
n = 8
:
22
4444
666666
88888888
n = 5
:
22
4444
Note: There are no spaces in the pattern.
Hint: Use \n
in string to jump to next line.
ASCII Art
Fundamentals
Similar Kata:
Stats:
Created | Jun 7, 2015 |
Published | Jun 7, 2015 |
Warriors Trained | 2791 |
Total Skips | 212 |
Total Code Submissions | 4709 |
Total Times Completed | 1818 |
JavaScript Completions | 687 |
Ruby Completions | 236 |
Python Completions | 838 |
C# Completions | 130 |
Total Stars | 31 |
% of votes with a positive feedback rating | 92% of 341 |
Total "Very Satisfied" Votes | 291 |
Total "Somewhat Satisfied" Votes | 46 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 15 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |