Skip to content

Optimize max area function#4

Open
glasss13 wants to merge 1 commit intoStep-3from
step-3-wip
Open

Optimize max area function#4
glasss13 wants to merge 1 commit intoStep-3from
step-3-wip

Conversation

@glasss13
Copy link
Owner

Questions

Please include the following when you are writing your PR:
General things:

  1. What is the purpose of this PR?
    Optimize max area function
  2. What changes did you make? Why?
    I optimized the max area function so that it runs within the alotted time
  3. What bugs did you find while testing?
    None.

This PR Specific:

  1. What was the bug you found?
    The initial function was running in O(n^2) which is inefficient
  2. How did you address it?
    Changed the algorithm to use a two pointer approach to run in O(n)
  3. What did you struggle with?
    Nothing
  4. Is there anything you would change about this step?
    No
  5. What was the code given to you by the tests?
    Slow

@glasss13 glasss13 assigned glasss13 and unassigned glasss13 Jan 11, 2024
Copy link

@minnce minnce left a comment

Choose a reason for hiding this comment

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

nice! lgtm

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