Daily Coding Problem #1
Apr 28, 2021
Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.
Explanation:
We get the list of numbers & a number and store it in input_nums
& k
variables respectively. We run through two for loops:
i running from 0 to len(input_nums)
j running from i + 1 to len(input_nums)
Now we evaluate if(input_nums[i] + input_nums[j] == k)
to return True
Hence Coded :)