Skip to main content
added 4 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E, 17 17 16 bytes

b8jJð0:IgbgôC0K<è₁+b€¦JIgbgôC0K<è

Port of @emanresuA's Vyxal answer, so make sure to upvote him/her as well!
-1 byte thanks to @CommandMaster

Outputs as a list of characters.

Try it onlineTry it online or verify all test casesverify all test cases.

Explanation:

b₁+               # Add #256 Convertto theeach integersinteger in the first (implicit) input-list to
  b              # Convert #them to binary-strings
 8j   €¦            # PadRemove the leading spaces"1" tofrom each to make their lengths 8
   J   J           # Join the list of strings together
    ð0:           # Replace all spaces with 0s
       I          # Push the second input-string
        g         # Pop and push its length
         b        # Convert it to binary
          g       # Pop and push its length
           ô      # Split the earlier string into parts of that size
            C     # Convert each inner string from binary to a base-10 integer
             0K   # Remove all 0s
               <  # Decrease each by 1 the 1-based indices 0-based
                è # Use it to index into the second (implicit) input-string
                  # (after which the resulting list is output implicitly)

05AB1E, 17 bytes

b8jJð0:IgbgôC0K<è

Port of @emanresuA's Vyxal answer, so make sure to upvote him/her as well!

Outputs as a list of characters.

Try it online or verify all test cases.

Explanation:

b                 # Convert the integers in the (implicit) input-list to
                  # binary-strings
 8j               # Pad leading spaces to each to make their lengths 8
   J              # Join the list of strings together
    ð0:           # Replace all spaces with 0s
       I          # Push the second input-string
        g         # Pop and push its length
         b        # Convert it to binary
          g       # Pop and push its length
           ô      # Split the earlier string into parts of that size
            C     # Convert each inner string from binary to a base-10 integer
             0K   # Remove all 0s
               <  # Decrease each by 1 the 1-based indices 0-based
                è # Use it to index into the second (implicit) input-string
                  # (after which the resulting list is output implicitly)

05AB1E, 17 16 bytes

₁+b€¦JIgbgôC0K<è

Port of @emanresuA's Vyxal answer, so make sure to upvote him/her as well!
-1 byte thanks to @CommandMaster

Outputs as a list of characters.

Try it online or verify all test cases.

Explanation:

₁+               # Add 256 to each integer in the first (implicit) input-list
  b              # Convert them to binary-strings
   €¦            # Remove the leading "1" from each
     J           # Join the list of strings together
      I          # Push the second input-string
       g         # Pop and push its length
        b        # Convert it to binary
         g       # Pop and push its length
          ô      # Split the earlier string into parts of that size
           C     # Convert each inner string from binary to a base-10 integer
            0K   # Remove all 0s
              <  # Decrease each by 1 the 1-based indices 0-based
               è # Use it to index into the second (implicit) input-string
                 # (after which the resulting list is output implicitly)
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E, 17 bytes

b8jJð0:IgbgôC0K<è

Port of @emanresuA's Vyxal answer, so make sure to upvote him/her as well!

Outputs as a list of characters.

Try it online or verify all test cases.

Explanation:

b                 # Convert the integers in the (implicit) input-list to
                  # binary-strings
 8j               # Pad leading spaces to each to make their lengths 8
   J              # Join the list of strings together
    ð0:           # Replace all spaces with 0s
       I          # Push the second input-string
        g         # Pop and push its length
         b        # Convert it to binary
          g       # Pop and push its length
           ô      # Split the earlier string into parts of that size
            C     # Convert each inner string from binary to a base-10 integer
             0K   # Remove all 0s
               <  # Decrease each by 1 the 1-based indices 0-based
                è # Use it to index into the second (implicit) input-string
                  # (after which the resulting list is output implicitly)