summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-08-25 13:26:29 -0600
committermo khan <mo.khan@gmail.com>2020-08-25 13:26:29 -0600
commite7255f58b161b290d4e066d58098bc4ab152e674 (patch)
treedbf21d6c6c260942ce2647857652849a3e5037a2
parent773f8dfa33535c649279e79bc9cb57c415ee9c62 (diff)
Add card game problem
-rw-r--r--2020/08/25/README.md0
-rw-r--r--misc/cards/README.md36
2 files changed, 36 insertions, 0 deletions
diff --git a/2020/08/25/README.md b/2020/08/25/README.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/2020/08/25/README.md
diff --git a/misc/cards/README.md b/misc/cards/README.md
new file mode 100644
index 0000000..39d1c49
--- /dev/null
+++ b/misc/cards/README.md
@@ -0,0 +1,36 @@
+Card game
+
+You will be building a program to play a card game.
+The objective of the game is to form a hand of three
+cards that for each of three different properties are
+either all the same or all different.
+
+The properties of a card are:
+1. Prefix: "+", "-", or "="
+2. Letter: "A", "B", or "C"
+3. Number of letters: 1, 2, or 3 (e.g. A, AA, AAA)
+
+For example, given the following set of cards
+
+> -A -B -BB +C -C -CC =CCC
+
+there are two possible hands:
+
+1. `+C -CC =CCC`
+ * prefix: +,-,= are all different
+ * letter: C, C, C are all the same
+ * number of letters: 1, 2, 3 are all different
+
+2. `-A -B -C`
+ * Prefix: -, -, - are all the same
+ * Letter: A, B, C are all different
+ * Number of letters: 1, 1, 1 are all the same
+
+Specifications:
+- You only need to find one hand
+- The cards should be read from STDIN,
+each card is separated by a space
+- Print the hand you find to STDOUT,
+space separated (trailing space is ok)
+- Cards may appear in any order in the input
+- Cards may be output in any order