Skip to main content
added 60 characters in body
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Japt, 1111 10 bytes

ò1õ ò@VøYÃcÔ

Try itTry it

-1 by Shaggy (crossed out 11 is still regular 11)

ò1õ ò@VøYÃcÔ 
ò1õ          # range [1, input integer]
   ò@   Ã   # partitioned between pairs X, Y where
     VøY    #   Y is contained in input array
         cÔ # reverse each and flatten

Japt, 11 bytes

ò1 ò@VøYÃcÔ

Try it

ò1 ò@VøYÃcÔ 
ò1          # range [1, input integer]
   ò@   Ã   # partitioned between pairs X, Y where
     VøY    #   Y is contained in input array
         cÔ # reverse each and flatten

Japt, 11 10 bytes

õ ò@VøYÃcÔ

Try it

-1 by Shaggy (crossed out 11 is still regular 11)

õ ò@VøYÃcÔ 
õ          # range [1, input integer]
  ò@   Ã   # partitioned between pairs X, Y where
    VøY    #   Y is contained in input array
        cÔ # reverse each and flatten
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Japt, 11 bytes

ò1 ò@VøYÃcÔ

Try it

ò1 ò@VøYÃcÔ 
ò1          # range [1, input integer]
   ò@   Ã   # partitioned between pairs X, Y where
     VøY    #   Y is contained in input array
         cÔ # reverse each and flatten