From 28ee8b94fdcffdf27d08820c7d31aff38a8d1561 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sun, 16 Aug 2020 20:00:58 -0600 Subject: Add daily problem of the day --- 2020/08/16/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 2020/08/16/README.md 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. + -- cgit v1.2.3