aboutsummaryrefslogtreecommitdiff
path: root/challenge-038/duncan-c-white/README
blob: bbaa601b99b66f986ec786160358d5173777c863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Challenge 1: "Date Finder

Create a script to accept a 7 digits number, where the first
number can only be 1 or 2. The second and third digits can be
anything 0-9. The fourth and fifth digits corresponds to the month
i.e. 01,02,03....11,12. And the last 2 digits respresents the days in
the month i.e. 01,02,03....29,30,31. Your script should validate if
the given number is valid as per the rule and then convert into human
readable format date.

RULES

1) If 1st digit is 1, then prepend 20 otherwise 19 to the 2nd and 3rd
   digits to make it 4-digits year.

2) The 4th and 5th digits together should be a valid month.

3) The 6th and 7th digits together should be a valid day for the above month.

For example, the given number is 2230120, it should print 1923-01-20.
"

My notes: sounds rather straightforward, with or without date manipulation
modules.  Reuse the "number of days in the month" code.


Challenge 2: "Word Game

Lets assume we have tiles as listed below, with an alphabet (A..Z)
printed on them. Each tile has a value, e.g. A (1 point), B (4 points)
etc. You are allowed to draw 7 tiles from the lot randomly. Then try
to form a word using the 7 tiles with maximum points altogether. You
don't have to use all the 7 tiles to make a word. You should try to
use as many tiles as possible to get the maximum points.

For example, A (x8) means there are 8 tiles with letter A.

1 point: A (x8), G (x3), I (x5), S (x7), U (x5), X (x2), Z (x5)

2 points: E (x9), J (x3), L (x3), R (x3), V (x3), Y (x5)

3 points: F (x3), D (x3), P (x5), W (x5)

4 points: B (x5), N (x4)

5 points: T (x5), O (x3), H (x3), M (x4), C (x4)

10 points: K (x2), Q (x2)
"

My notes: So not scrabble then:-)