Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Steps generator

Instructions

Given a positive integer n implement a function which returns an array representing the generated steps with n levels using the # character. Make sure the step has appropriate number of spaces on the right hand side!

Challenge | solution

Examples

generate_steps(2)
    '# '
    '##'

generate_steps(3)
    '#  '
    '## '
    '###'

generate_steps(4)
    '#   '
    '##  '
    '### '
    '####'