Skip to content

Instantly share code, notes, and snippets.

@eduardopoleo
Last active July 27, 2017 01:22
Show Gist options
  • Save eduardopoleo/03fe30ee8b6a507e16beead1ca74a581 to your computer and use it in GitHub Desktop.
Save eduardopoleo/03fe30ee8b6a507e16beead1ca74a581 to your computer and use it in GitHub Desktop.
+----------------+------------------------+----------------+
| Solution | Elapsed Real Time (s)* | Space(bytes)** |
+----------------+------------------------+----------------+
| Brute Force | 168.1 | N/A |
| Hash | 9.8 | 6488 |
| Array | 3.14 | 1064 |
| Bit Array | 6.2 | 40 |
| Web Developer | 9.7 | 2128 |
+----------------+-----------------------------------------+
* Total elapsed time calculated for 100,000 runs / solution.
* * Memory space was calculated using Ruby's Object.memsize_of(obj)
which according to the documentation notes "is incomplete" but we
can still use it to compare the relative magnitudes of our solutions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment