Describe a time you had to debug Go code using waitgroups.
For this coding exercise, analyze an abstract event trace and return the first detected issue. Events are ['Add', n], ['Done'], ['WaitStart'], or ['WaitEnd']. Return "ok", "negative-counter", "add-during-wait", or "deadlock".
The input is a list of event arrays. Add increases the counter, Done decreases it, and WaitEnd is valid only after a started wait observes a zero counter. An Add during an active wait is invalid.
def analyze_waitgroup_events(events):