Problem 1115 · Medium

Print FooBar Alternately

Two threads print foo and bar alternately n times, using two permits that hand control back and forth.

Open the interactive visualisation