Fewest conflicts when merging branches

0
Remix

Several branches have to be merged, and the order of the merges changes how many commit conflicts come up. Given the branches and how conflicts arise between them, return the fewest conflicts any merge order can produce. Trying every order works only for tiny inputs; find a dynamic-programming solution.

AmazonOnline assessmentLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.