Back to problems

Minimize Branch Merge Conflicts

Algorithm · Amazon · Hard

Several feature branches are ready to be integrated into a main branch. Each branch is represented by its commits, and each commit records the file paths that it modifies. You may choose the merge order. The first branch in that order introduces no conflicts. For any later branch, a commit is considered conflicting if it modifies at least one path already touched by any earlier-merged branch. If a commit overlaps several previously touched paths, it is still counted only…

Checking your access…