Skip to content

Commit

Permalink
Update solution.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan committed Dec 25, 2024
1 parent 710e437 commit d33aef1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kyu_7/complete_the_pattern_5_even_ladder/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ def pattern(n: int) -> str:
# If n <= 1 then it should return "" (i.e. empty string).
if n < 2:
return ''
#If any odd number is passed as argument then the pattern
# If any odd number is passed as argument then the pattern
# should last up to the largest even number which is smaller
# than the passed odd number.
lines: list = []
for i in range(2, n + 1, 2):
# Note: There are no spaces in the pattern.
line = (f'{i}' * i)
lines.append(line)
lines.append(f'{i}' * i)
# Use \n in string to jump to next line.
return '\n'.join(lines)

0 comments on commit d33aef1

Please sign in to comment.