summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-08-17 10:11:05 -0600
committermo khan <mo.khan@gmail.com>2020-08-17 10:11:05 -0600
commit377586ec57812f6d773fea2531bb9f2d1db9dd6b (patch)
treec60399465af6b5ac61fe734345dabd3f0fcb66a3
parent587cef8e24fca3537f9993aea27043f5507720b4 (diff)
Add problem of the day
-rw-r--r--2020-08-17/README.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/2020-08-17/README.md b/2020-08-17/README.md
new file mode 100644
index 0000000..1203926
--- /dev/null
+++ b/2020-08-17/README.md
@@ -0,0 +1,14 @@
+You are given a list of numbers, and a target number k.
+Return whether or not there are two numbers in the list that add up to k.
+
+Example:
+Given [4, 7, 1 , -3, 2] and k = 5,
+return true since 4 + 1 = 5.
+
+def two_sum(list, k):
+ # Fill this in.
+
+print two_sum([4,7,1,-3,2], 5)
+# True
+
+Try to do it in a single pass of the list.