May 12, 2022
Thanks for the article; a small suggestion would be to add the item unmodified to the temporary DS and to perform doubling/halving in the test. I believe this improves readibility. See the JS implementation at (not mine) https://dev.to/kira/leetcode-1346-check-if-n-and-its-double-exist-1n6p#solution-2-hash-table