Skip to main content
4 of 4
Commonmark migration

QBIC, 25 bytes

:[0,a,sgn(a)|A=A+!b$]?_lA

Explanation:

:[0,a     Read 'a' from the cmd line, start a FOR loop from 0 to 'a'
,sgn(a)|  with incrementer set to -1 for negative ranges and 1 for positive ones
A=A+!b$   Add a string cast of each iteration (var 'b') to A$
]         NEXT
?_lA      Print the length of A$
steenbergh
  • 8.1k
  • 1
  • 25
  • 41