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.
Permalink
Failed to load latest commit information.
map_tests
README.md
harness.rb
solution.rb

README.md

Density map in three ways

This is a solution to Density Map problem. For more information read this blog post http://www.visuality.pl/posts/cs-lessons-003-density-map-three-ways

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