kotlin-coding-challenges

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)
    '#   '
    '##  '
    '### '
    '####'