Two Sum Problem

coding challenges

Two sum problem


return a boolean if there are two numbers in the array that equal to given sum

Solving guide

there are three ways to solve this problem. execution efficiency is differed through each solution.

1 - brute force

this is not the most efficient solution. in here we compare all the numbers using nested for loops and find the matching pair.

3 - move pointers from either end - linear