<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>code on Asa&#39;s Website</title><link>https://ahessmat.netlify.com/tags/code/</link><description>Recent content in code on Asa&#39;s Website</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Fri, 23 Jul 2021 17:08:10 +0000</lastBuildDate><atom:link href="https://ahessmat.netlify.com/tags/code/index.xml" rel="self" type="application/rss+xml"/><item><title>The Two-Sum Problem</title><link>https://ahessmat.netlify.com/post/2021-07-the-two-sum-problem/</link><pubDate>Fri, 23 Jul 2021 17:08:10 +0000</pubDate><guid>https://ahessmat.netlify.com/post/2021-07-the-two-sum-problem/</guid><description>The Two-Sum problem is a simple interview question where:
&amp;hellip;given an array of integers of varying values (both positive and negative; they may repeat)&amp;hellip; &amp;hellip;and a target integer that is achievable&amp;hellip; &amp;hellip;identify the 2 integers in the array (by index) that - when summed together - equate to the target; an element may only be used once. I initially thought to try a brute-force solution, wherein I would iterate over every entry in the list and see if that would match to an entry we had seen before:</description></item></channel></rss>