Ad
  • Default User Avatar

    Sheldon drink the 1st, so Leonard drink the 2nd

  • Custom User Avatar

    After a person drinks cola once, he's added to the end of the queue 2 more times:

    [A, B, C] -> [B, C, A, A] -> [C, A, A, B, B] -> [A, A, B, B, C, C] -> [A, B, B, C, C, A, A] -> ...
    
  • Default User Avatar

    It is easier to think about the Cola as a magic potion. Each time someone drinks it, the person duplicates (becomes 2 people) and these new entities go back to the end of the queue. Knowing that, the first to drink is Sheldon and the new queue is:
    ["Leonard", "Penny", "Rajesh", "Howard", "Sheldon", "Sheldon"]
    The second person to drink is therefore Leonard. He will duplicate as well and the two new Leoanard will go back to the end of the queue. The new queue will be:
    ["Penny", "Rajesh", "Howard", "Sheldon", "Sheldon", "Leonard", "Leonard"]
    And so on... the queue keeps growing each time someone drinks.
    Good luck!

  • Custom User Avatar

    It will be Leonard.
    Sheldon drank the first one and then go to the back of the queue doubled.
    After the first drank, list becomes: ["Leonard", "Penny", "Rajesh", "Howard", "Sheldon", "Sheldon"].