grokking_algorithms
grokking_algorithms copied to clipboard
Refactor: replace helper function with map
trafficstars
Since we were introduced to hash tables in the previous chapter, I thought it would be great to use them in practice in this example. Using a map to store searched/visited items is effective and simplifies the code.
In the book's example, Python's set() was used for this purpose, and map is the Go counterpart for that.