aboutsummaryrefslogtreecommitdiff
path: root/challenge-142/duncan-c-white/README
blob: 5a433917bedb11b1924d9e76cf3b35cff3e91cc7 (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
TASK #1 - Divisor Last Digit

You are given positive integers, $m and $n.

Write a script to find total count of divisors of $m having last digit $n.

Example 1:

	Input: $m = 24, $n = 2
	Output: 2

	The divisors of 24 are 1, 2, 3, 4, 6, 8 and 12.
	There are only 2 divisors having last digit 2 are 2 and 12.


Example 2:

	Input: $m = 30, $n = 5
	Output: 2

	The divisors of 30 are 1, 2, 3, 5, 6, 10 and 15.
	There are only 2 divisors having last digit 5 are 5 and 15.

MY NOTES: Very easy.


TASK #2 - Sleep Sort

Another joke sort similar to JortSort suggested by champion Adam Russell.

You are given a list of numbers.

Write a script to implement Sleep Sort. For more information:

for n in array
	create a new thread and make it sleep for array[n] milliseconds
	print array[n]
end
wait for all processes to finish

MY NOTES: threaded sorting? weird.  not sure I can be bothered..