logo

Back to questions

Merge Conflicts [Microsoft Python Interview Question]

Medium

Imagine you are working on a code version-control system website, similar to GitHub.

You are given a list of , and each element within the list represents a range of lines which that were changed in a specific pull request.

Your job is to write a function called which returns or , depending on if there is or is not any merge conflict. In this case, a merge conflict means two different pull requests are trying to change the same exact lines.

For example, if you were given the input .

We'd output because there is a merge conflict: two different pull requests trying to change lines between 25 and 40.

Here's another example: say you had the input .

You'd return because there is no merge conflict – none of these pull requests are trying to change the same lines.

Python