Thanks for the illustration how to solve problems iteratively: from the basic solution to the most performant.
Before reading this post I'd solve the "jewels and stones" problem by creating a js object and populating it with "jewels" keys. But using a Set collection with has method is more elegant and straightforward solution, thanks 😄
Thanks for the illustration how to solve problems iteratively: from the basic solution to the most performant.
Before reading this post I'd solve the "jewels and stones" problem by creating a js object and populating it with "jewels" keys. But using a Set collection with
has
method is more elegant and straightforward solution, thanks 😄Glad you found it helpful! I always appreciate when articles build up to the optimal solution 👍
Sets are also very cool 😎