Skip to main content
added explanation
Source Link
wastl
  • 3.9k
  • 14
  • 33

Stax, 20 19 18 1612 bytes

ü°√¿«│⌠º₧@\τ

Run and debug it

Using this algorithm.

Explanation:

c%R:BXm]i*xit+ Full program, implicit input
c%             Length of input
  R            1-based range
   :B          Repeat each element according to the range ("123" -> "122333")
     X         Save to X register
      m        Map:
       ]         Character -> string
        i*       Repeat by iteration index
          xit    Trim first <iteration index> elements from X
             +   Concatenate
                 Implicit output with newline

Stax, 20 19 18 16 bytes

ù↔‼i,ÑΓæ☺=╘‼æ↕4╝

Run and debug it

Explanation:

c%R:BX%mYx%{y|Mvx@m Full program, implicit input
c%                  Length of input
  R                 1-based range
   :B               Repeat each element according to the range ("123" -> "122333")
     X              Save to X register
      %             Length
       m            Map over 1-based range:
        Y             Save index to Y register
         x%           Push length of X register
           {      m   Map over 1-based range:
            y|M         Maximum of both indices
               v        1-based -> 0-based (decrement)
                x@      Index into X register
                      Implicit output with newline

Stax, 20 19 18 16 bytes

ù↔‼i,ÑΓæ☺=╘‼æ↕4╝

Run and debug it

Explanation:

c%R:BX%mYx%{y|Mvx@m Full program, implicit input
c%                  Length of input
  R                 1-based range
   :B               Repeat each element according to the range ("123" -> "122333")
     X              Save to X register
      %             Length
       m            Map over 1-based range:
        Y             Save index to Y register
         x%           Push length of X register
           {      m   Map over 1-based range:
            y|M         Maximum of both indices
               v        1-based -> 0-based (decrement)
                x@      Index into X register
                      Implicit output with newline

Stax, 12 bytes

ü°√¿«│⌠º₧@\τ

Run and debug it

Using this algorithm.

Explanation:

c%R:BXm]i*xit+ Full program, implicit input
c%             Length of input
  R            1-based range
   :B          Repeat each element according to the range ("123" -> "122333")
     X         Save to X register
      m        Map:
       ]         Character -> string
        i*       Repeat by iteration index
          xit    Trim first <iteration index> elements from X
             +   Concatenate
                 Implicit output with newline

Stax, 20 19 18 16 bytes

ù↔‼i,ÑΓæ☺=╘‼æ↕4╝

Run and debug it

Explanation:

c%R:BX%mYx%{y|Mvx@m Full program, implicit input
c%                  Length of input
  R                 1-based range
   :B               Repeat each element according to the range ("123" -> "122333")
     X              Save to X register
      %             Length
       m            Map over 1-based range:
        Y             Save index to Y register
         x%           Push length of X register
           {      m   Map over 1-based range:
            y|M         Maximum of both indices
               v        1-based -> 0-based (decrement)
                x@      Index into X register
                      Implicit output with newline
fixed indentation in expl.
Source Link
wastl
  • 3.9k
  • 14
  • 33

Stax, 20 19 18 18 16 bytes

ü├¶∟↓-[jvªjGM+J☺^)ù↔‼i,ÑΓæ☺=╘‼æ↕4╝

Run and debug it

Explanation:

c%R:BX%mYx%{y|Mvx@m Full program, implicit input
c%                  Length of input
  R                 1-based range
   :B               Repeat each element according to the range ("123" -> "122333")
     X              Save to X register
      %             Length
       m            Map over 1-based range:
        Y             Save index to Y register
         x%           Push length of X register
           {      m   Map over 1-based range:
            y|M         Maximum of both indices
               v        1-based -> 0-based (decrement)
                x@      Index into X register
                      Implicit output with newline

Stax, 20 19 18 bytes

ü├¶∟↓-[jvªjGM+J☺^)

Run and debug it

Stax, 20 19 18 16 bytes

ù↔‼i,ÑΓæ☺=╘‼æ↕4╝

Run and debug it

Explanation:

c%R:BX%mYx%{y|Mvx@m Full program, implicit input
c%                  Length of input
  R                 1-based range
   :B               Repeat each element according to the range ("123" -> "122333")
     X              Save to X register
      %             Length
       m            Map over 1-based range:
        Y             Save index to Y register
         x%           Push length of X register
           {      m   Map over 1-based range:
            y|M         Maximum of both indices
               v        1-based -> 0-based (decrement)
                x@      Index into X register
                      Implicit output with newline
improved score
Source Link
wastl
  • 3.9k
  • 14
  • 33

Stax, 20 19 19 18 bytes

╛▲G≥ôÿ☻*_:ÉZ╪;Z4↕‼╝ü├¶∟↓-[jvªjGM+J☺^)

Run and debug itRun and debug it

Stax, 20 19 bytes

╛▲G≥ôÿ☻*_:ÉZ╪;Z4↕‼╝

Run and debug it

Stax, 20 19 18 bytes

ü├¶∟↓-[jvªjGM+J☺^)

Run and debug it

Source Link
wastl
  • 3.9k
  • 14
  • 33
Loading