Mark As Completed Discussion

Run through a few examples and notice we immediately grasp for two things-- we need to iterate and we need to compare. A simple brute force solution would be to try every single pair in the array and check it against the goal number.

We can do this via a nested for-loop, with the outer loop iterating through all elements in the array. The inner loop would check the outer loop's current element against every other element, and see if they add up to the target.

Pseudocode as follows:

SNIPPET
1for num in nums:
2  for otherNum in nums:
3    if num + otherNum == target:
4      return true
5return false