summaryrefslogtreecommitdiff
path: root/2020
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-08-16 20:00:58 -0600
committermo khan <mo.khan@gmail.com>2020-08-16 20:00:58 -0600
commit28ee8b94fdcffdf27d08820c7d31aff38a8d1561 (patch)
tree16647b4d797dd2670f4dd1920a86f33835649d12 /2020
parentbf26bed9354ce8534dbf994ddd85aa717bcf4994 (diff)
Add daily problem of the day
Diffstat (limited to '2020')
-rw-r--r--2020/08/16/README.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/2020/08/16/README.md b/2020/08/16/README.md
new file mode 100644
index 0000000..b59dd9a
--- /dev/null
+++ b/2020/08/16/README.md
@@ -0,0 +1,14 @@
+│ Given a list of numbers with only 3 unique numbers (1, 2, 3),
+│sort the
+│ list in O(n) time.
+│ Example 1:
+│Input: [3, 3, 2, 1, 3, 2, 1]
+│Output: [1, 1, 2, 2, 3, 3, 3]
+│
+│def sortNums(nums):
+│ # Fill this in.
+│print sortNums([3, 3, 2, 1, 3, 2, 1])
+│# [1, 1, 2, 2, 3, 3, 3]
+│
+│ Challenge: Try sorting the list using constant space.
+