Many solutions to Density Map problem with different time complexity
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Density map in three ways

This is a solution to Density Map problem. For more information read this blog post

Follow these steps to run it:

  1. Clone the repository
  2. Open solution.rb file and uncomment one of the run_ methods at the bottom:
    • run_naive_solution O(n^4)
    • run_better_solution O(n^3)
    • run_optimal_solution O(n^2)
    • run_official_solution O(n^2)
  3. Run ruby harness.rb
  4. Feel free to replace solution.rb with your own implementation
  5. Share if you liked it