7 kyu

Down Arrow With Numbers

464 of 932tfKamran

Description:

Given a number n, make a down arrow shaped pattern.

For example, when n = 5, the output would be:

123454321
 1234321
  12321
   121
    1

and for n = 11, it would be:

123456789010987654321
 1234567890987654321
  12345678987654321
   123456787654321
    1234567654321
     12345654321
      123454321
       1234321
        12321
         121
          1
          

An important thing to note in the above example is that the numbers greater than 9 still stay single digit, like after 9 it would be 0 - 9 again instead of 10 - 19.

Note:

  • There are spaces for the indentation on the left of each line and no spaces on the right.
  • Return "" if given n<1.

Have fun!

Algorithms

Stats:

CreatedNov 13, 2015
PublishedNov 13, 2015
Warriors Trained2369
Total Skips146
Total Code Submissions5929
Total Times Completed932
JavaScript Completions392
Python Completions464
Ruby Completions105
Scala Completions10
Total Stars58
% of votes with a positive feedback rating88% of 215
Total "Very Satisfied" Votes173
Total "Somewhat Satisfied" Votes34
Total "Not Satisfied" Votes8
Ad
Contributors
  • tfKamran Avatar
  • alchemy Avatar
  • CrazyMerlyn Avatar
  • Blind4Basics Avatar
  • FArekkusu Avatar
  • ejini战神 Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad