5 kyu
Complete the triangle pattern
91 of 197myjinxin2015
Description:
When no more interesting kata can be resolved, I just choose to create the new kata, to solve their own, to enjoy the process --myjinxin2015 said
Description:
Give you two number m
and n
(two positive integer, m < n), make a triangle pattern with number sequence m to n
. The order is clockwise, starting from the top corner, like this:
When m=1 n=10 triangle is:
1
9 2
8 0 3
7 6 5 4
Note: The pattern only uses the last digit of each number; Each row separated by "\n"; Each digit separated by a space; Left side may need pad some spaces, but don't pad the right side; If m to n
can not make the triangle, return ""
.
Some examples:
makeTriangle(1,3) should return:
1
3 2
makeTriangle(6,20) should return:
6
7 7
6 8 8
5 0 9 9
4 3 2 1 0
makeTriangle(1,12) should return ""
Puzzles
Similar Kata:
Stats:
Created | Nov 13, 2016 |
Published | Nov 13, 2016 |
Warriors Trained | 1447 |
Total Skips | 96 |
Total Code Submissions | 1547 |
Total Times Completed | 197 |
JavaScript Completions | 91 |
Python Completions | 108 |
Haskell Completions | 6 |
Total Stars | 63 |
% of votes with a positive feedback rating | 93% of 64 |
Total "Very Satisfied" Votes | 55 |
Total "Somewhat Satisfied" Votes | 9 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 8 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |