Write a basic semaphore in Go using channels.
Asked in the Technical round (Golang) stage. For grading, model the semaphore operations deterministically rather than blocking goroutines.
Implement semaphore_operations(capacity, operations). capacity is a positive integer. Each operation is either "acquire" or "release". Return a Boolean for each operation: true when it can proceed and false when it would block. An acquire consumes one available slot; a release frees one occupied slot.
def semaphore_operations(capacity, operations):