Skip to main content
improved score, added alternative
Source Link
wastl
  • 3.9k
  • 14
  • 33

Stax, 12 14 14 13 bytes

ü÷╛╣┐ù▐L╘2t*à÷àJ├∙ε╝F▀ÿi☻Ia

Run and debug itRun and debug it

Explanation:

vsc{%1>fr$r+@]|u%vfr$r+@]|u Full program, unpacked, implicit input
vs               Decrement the number and get the list
  c{   f         Copy and filter:
    %1>%v            Length greaternot thanequal to 1?
        r$r      Reverse, flatten, and reverse again
           +     Concat orig array and and modified array
            @]|u Index, wrap into array, uneval

Stax, 12 bytes

Å{b≈\☼╣Δ@░ ‼

Unpacked:

{vsc{%vfr$r+@}

This is a block, so I can get rid of the ]|u, but I don't know if this is valid as it's packing a block.

Stax, 12 14 bytes

ü÷╛╣┐ù▐L╘2t*à÷

Run and debug it

Explanation:

vsc{%1>fr$r+@]|u Full program, unpacked, implicit input
vs               Decrement the number and get the list
  c{   f         Copy and filter:
    %1>            Length greater than 1?
        r$r      Reverse, flatten, and reverse again
           +     Concat orig array and and modified array
            @]|u Index, wrap into array, uneval

Stax, 12 14 13 bytes

àJ├∙ε╝F▀ÿi☻Ia

Run and debug it

Explanation:

vsc{%vfr$r+@]|u Full program, unpacked, implicit input
vs              Decrement the number and get the list
  c{  f         Copy and filter:
    %v            Length not equal to 1?
       r$r      Reverse, flatten, and reverse again
          +     Concat orig array and and modified array
           @]|u Index, wrap into array, uneval

Stax, 12 bytes

Å{b≈\☼╣Δ@░ ‼

Unpacked:

{vsc{%vfr$r+@}

This is a block, so I can get rid of the ]|u, but I don't know if this is valid as it's packing a block.

corrected program, added explanation
Source Link
wastl
  • 3.9k
  • 14
  • 33

Stax, 12 12 14 bytes

ÄB╝æNf£(ïb░Üü÷╛╣┐ù▐L╘2t*à÷

Run and debug itRun and debug it

Explanation:

vsc{%1>fr$r+@]|u Full program, unpacked, implicit input
vs               Decrement the number and get the list
  c{   f         Copy and filter:
    %1>            Length greater than 1?
        r$r      Reverse, flatten, and reverse again
           +     Concat orig array and and modified array
            @]|u Index, wrap into array, uneval

Stax, 12 bytes

ÄB╝æNf£(ïb░Ü

Run and debug it

Stax, 12 14 bytes

ü÷╛╣┐ù▐L╘2t*à÷

Run and debug it

Explanation:

vsc{%1>fr$r+@]|u Full program, unpacked, implicit input
vs               Decrement the number and get the list
  c{   f         Copy and filter:
    %1>            Length greater than 1?
        r$r      Reverse, flatten, and reverse again
           +     Concat orig array and and modified array
            @]|u Index, wrap into array, uneval
Source Link
wastl
  • 3.9k
  • 14
  • 33

Stax, 12 bytes

ÄB╝æNf£(ïb░Ü

Run and debug it