Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highest region algorithm #129

Open
wants to merge 13 commits into
base: classes-and-types
Choose a base branch
from

Conversation

KameronKeller
Copy link

@KameronKeller KameronKeller commented Apr 5, 2024

What this is:

  • Implements an algorithm for locating the highest region and adds a main function for a sample run of the program
  • models/highestregionlocator.ts
    • Implemented locateHighestRegion() for locating the highest region in an event stream. This algorithm solves this problem with a time complexity of O(n).
  • models/region.ts
    • Removed an inefficient function for adding events to a region
  • index.ts
    • Added function calls for a sample run of the program
  • index.test.ts
    • Added tests for locating the highest scoring region
  • assets/obviousAnswerSampleData.ts
    • This is a sample event stream with an obvious answer useful for validating the algorithm with tests

Issue:

N/A

Media:

Screen.Recording.2024-04-05.at.3.31.58.PM.mov

Steps to Verify:

  • Clone the branch
  • Run yarn install

To run the program:

  • Run yarn dev

To test the program:

  • Run yarn test

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.

1 participant