Company: Somethng
Difficulty: medium
Problem D: Crash Course Description Alice and Bob are back at their favorite restaurant: Nim Sum Dim Sum. They are sitting on opposite sides of a long table, with Alice on the left. Between them are N plates (expressed as a string S 1.. N ), each containing either Almond Jelly ('A') or BBQ Bao ('B'). Alice is hungry only for almond jelly, and Bob only for BBQ baos. They take turns eating as follows: Alice will select an almond jelly plate of her choice, and pull on the very long tablecloth until that plate is in front of her, sending the prefix of dishes before crashing to the ground. She'll then eat the jelly. Bob will then select a BBQ bao plate of his choice, and pull on the tablecloth until that plate reaches the right end of the table (also knocking over a suffix of dishes), and eat the bao. This repeats until every dish is either eaten or knocked to the ground. If on a player's turn there are no remaining dishes of their preferred type, they will skip their turn without doing any