Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 460 Bytes

File metadata and controls

28 lines (20 loc) · 460 Bytes

Steps generator

Instructions

Given a positive integer n implement a function which returns a list 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

steps(2)
    '# '
    '##'

steps(3)
    '#  '
    '## '
    '###'

steps(4)
    '#   '
    '##  '
    '### '
    '####'