1
0
www.mikescher.com/www/statics/euler/euler_062_explanation.md

7 lines
494 B
Markdown
Raw Normal View History

2017-11-08 17:39:50 +01:00
Only after at least sixty-two mathematical programs in befunge you will **truly** appreciate a hashtable.
For real, everything would be so much better if I could retrieve this stuff in `O(1)`.
My approach is pretty straight-forward. We calculate an permutation-insensitive hash.
Then store them together with the times it appeared in a hashmap *(I mean a list -.-)*.
Now we just go through all the cubes until a single hash appeared five times. In C# with a Dictionary this takes around 10ms.