You're given a list of function-call trace entries representing the execution of a program. Each entry is one of:
"-> functionName" — the function is being called (pushed onto the call stack)."<- functionName" — the function is returning (popped off the call stack).A complete call stack at any point in time is the sequence of currently-active function names from the program's entry point down to the most recently entered function, joined with "->".
Each time a function is pushed (entered), the new full call stack is "observed". Find the call stack string that is observed most frequently across the entire trace. If multiple stacks tie on frequency, return the one that appears first in the trace.
Example: ` traces = [ "-> main", "-> eventClick", "-> eventClickAction", "<- eventClickAction", "-> eventClickAction", "<- eventClickAction", "<- eventClick", "<- main" ]
Stacks observed (one per push): push main -> "main" push eventClick -> "main->eventClick" push eventClickAction -> "main->eventClick->eventClickAction" push eventClickAction (2nd time) -> "main->eventClick->eventClickAction"
Output: "main->eventClick->eventClickAction" (observed 2 times) `
You may assume the trace is well-formed: every <- matches the most recent -> (LIFO).
Constraints: