Commit e7255f5

mo khan <mo.khan@gmail.com>
2020-08-25 19:26:29
Add card game problem
1 parent 773f8df
Changed files (2)
2020
misc
2020/08/25/README.md
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