grokking_algorithms icon indicating copy to clipboard operation
grokking_algorithms copied to clipboard

Refactor: replace helper function with map

Open chtozamm opened this issue 1 year ago • 1 comments
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.

chtozamm avatar Jun 06 '24 10:06 chtozamm