Pregunta de entrevista de Bloomberg

Implement a mutex. Using binary semaphore, implement an n-counting semaphore.