7 kyu

Complete The Pattern #3 (Horizontal Image of #2)

682 of 2,201DivyanshBatham

Description:

Task:

You have to write a function pattern which creates the following pattern upto n number of rows. If the Argument is 0 or a Negative Integer then it should return "" i.e. empty string.

Pattern:

(n)
(n)(n-1)
(n)(n-1)(n-2)
................
.................
(n)(n-1)(n-2)....4
(n)(n-1)(n-2)....43
(n)(n-1)(n-2)....432
(n)(n-1)(n-2)....4321

Examples:

pattern(4):

4
43
432
4321

pattern(6):

6
65
654
6543
65432
654321

Note: There are no blank spaces

Hint: Use \n in string to jump to next line

ASCII Art
Fundamentals

Stats:

CreatedJun 6, 2015
PublishedJun 6, 2015
Warriors Trained3857
Total Skips445
Total Code Submissions8185
Total Times Completed2201
JavaScript Completions682
Ruby Completions211
Python Completions761
Haskell Completions104
C# Completions140
C++ Completions403
Total Stars38
% of votes with a positive feedback rating90% of 423
Total "Very Satisfied" Votes348
Total "Somewhat Satisfied" Votes66
Total "Not Satisfied" Votes9
Ad
Contributors
  • DivyanshBatham Avatar
  • dnolan Avatar
  • Azuaron Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • siebenschlaefer Avatar
  • user5036852 Avatar
  • sharifahmad Avatar
  • Voile Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • solitude Avatar
Ad