Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@Ltwo3five
Copy link
Contributor

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

* otherwise.
*/

public static boolean isOverlap(int[][] ranges,int maximum) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is maximum? If it's the biggest point in ranges, it can be derived from ranges and doesn't need to be passed separately

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I will add logic to get the maximum value(Basically the largest end value in the array)

/** Line Sweep algorithm can be used to solve range problems by first sorting the list of ranges
* by the start value of the range in non-decreasing order and doing a "sweep" through the number
* line(x-axis) by incrementing the start point by 1 and decrementing end point by -1 on the
* number line. https://www.topcoder.com/thrive/articles/Line%20Sweep%20Algorithms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a link to Wikipedia

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@Ltwo3five
Copy link
Contributor Author

I created a feature branch and sent another pull request using that, and will reset my master branch to upstream

@Ltwo3five Ltwo3five closed this Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.