Skip to main content
deleted 53 characters in body
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 22 1616 15 bytes

Saved 6 bytes thanks to Nit noticing that the seat map could be taken as a string.

DŠvDyå·FyylsvDyå·Fyyl.;s]»

Try it online!Try it online!

Explanation

s                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
  v                    # for each passenger y
   Dyå                 # does a corresponding seat exist?
      ·F               # multiplied by 2 times do:
        yyl.;          # replace the first y with a lowercase y
             s         # and swap the seatmap and passengerlist on the stack
              ]        # end loops
               »       # join seatmap and passengerlist on newline and output

05AB1E, 22 16 bytes

Saved 6 bytes thanks to Nit noticing that the seat map could be taken as a string.

DŠvDyå·Fyyl.;s]»

Try it online!

Explanation

                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
  v                    # for each passenger y
   Dyå                 # does a corresponding seat exist?
      ·F               # multiplied by 2 times do:
        yyl.;          # replace the first y with a lowercase y
             s         # and swap the seatmap and passengerlist on the stack
              ]        # end loops
               »       # join seatmap and passengerlist on newline and output

05AB1E, 22 16 15 bytes

Saved 6 bytes thanks to Nit noticing that the seat map could be taken as a string.

svDyå·Fyyl.;s]»

Try it online!

Explanation

s                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
 v                    # for each passenger y
  Dyå                 # does a corresponding seat exist?
     ·F               # multiplied by 2 times do:
       yyl.;          # replace the first y with a lowercase y
            s         # and swap the seatmap and passengerlist on the stack
             ]        # end loops
              »       # join seatmap and passengerlist on newline and output
deleted 53 characters in body
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 2222 16 bytes

Saved 6 bytes thanks to Nit noticing that the seat map could be taken as a string.

JsDŠvDyå·FyylDŠvDyå·Fyyl.;s]¹gä»»;s]»

Try it online!Try it online!

Explanation

J                        # join seatmap to a single string
 sDŠ                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
    v                    # for each passenger y
     Dyå                 # does a corresponding seat exist?
        ·F               # multiplied by 2 times do:
          yyl.;          # replace the first y with a lowercase y
               s         # and swap the seatmap and passengerlist on the stack
                ]        # end loops
               »  ¹gä     # split thejoin seatmap to a list of rows again
                    »»  and #passengerlist joinon everythingnewline byand newlinesoutput

05AB1E, 22 bytes

JsDŠvDyå·Fyyl.;s]¹gä»»

Try it online!

Explanation

J                        # join seatmap to a single string
 sDŠ                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
    v                    # for each passenger y
     Dyå                 # does a corresponding seat exist?
        ·F               # multiplied by 2 times do:
          yyl.;          # replace the first y with a lowercase y
               s         # and swap the seatmap and passengerlist on the stack
                ]        # end loops
                 ¹gä     # split the seatmap to a list of rows again
                    »»   # join everything by newlines

05AB1E, 22 16 bytes

Saved 6 bytes thanks to Nit noticing that the seat map could be taken as a string.

DŠvDyå·Fyyl.;s]»

Try it online!

Explanation

                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
  v                    # for each passenger y
   Dyå                 # does a corresponding seat exist?
      ·F               # multiplied by 2 times do:
        yyl.;          # replace the first y with a lowercase y
             s         # and swap the seatmap and passengerlist on the stack
              ]        # end loops
               »       # join seatmap and passengerlist on newline and output
added 681 characters in body
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 22 bytes

JsDŠvDyå·Fyyl.;s]¹gä»»

Try it online!

Explanation

J                        # join seatmap to a single string
 sDŠ                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
    v                    # for each passenger y
     Dyå                 # does a corresponding seat exist?
        ·F               # multiplied by 2 times do:
          yyl.;          # replace the first y with a lowercase y
               s         # and swap the seatmap and passengerlist on the stack
                ]        # end loops
                 ¹gä     # split the seatmap to a list of rows again
                    »»   # join everything by newlines

05AB1E, 22 bytes

JsDŠvDyå·Fyyl.;s]¹gä»»

Try it online!

05AB1E, 22 bytes

JsDŠvDyå·Fyyl.;s]¹gä»»

Try it online!

Explanation

J                        # join seatmap to a single string
 sDŠ                     # setup stack as <passengerlist>,<seatmap>,<passengerlist>
    v                    # for each passenger y
     Dyå                 # does a corresponding seat exist?
        ·F               # multiplied by 2 times do:
          yyl.;          # replace the first y with a lowercase y
               s         # and swap the seatmap and passengerlist on the stack
                ]        # end loops
                 ¹gä     # split the seatmap to a list of rows again
                    »»   # join everything by newlines
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162
Loading