From e7255f58b161b290d4e066d58098bc4ab152e674 Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 25 Aug 2020 13:26:29 -0600 Subject: Add card game problem --- 2020/08/25/README.md | 0 misc/cards/README.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 2020/08/25/README.md create mode 100644 misc/cards/README.md diff --git a/2020/08/25/README.md b/2020/08/25/README.md new file mode 100644 index 0000000..e69de29 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 -- cgit v1.2.3