Algorithm · Capital One · Easy
You receive logs, a sequence of version-control actions, and must replay them one after another. Each entry takes one of two forms: "switch branch": makes the branch called branch the active one. "push filename": sends a single file to whichever branch is active at that moment. At the start, no branch is active. Moving to another branch keeps every count accumulated so far. After processing everything, return the name of the branch that has accumulated the most pushed files…