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
|
Task 1: "3 Sum
Given an array @L of integers, and a target T. Write a script to find
all unique triplets such that a + b + c is same as the target T. Also
make sure a <= b <= c.
Example:
@L = (-25, -10, -7, -3, 2, 4, 8, 10);
One such triplet for target 0 i.e. -10 + 2 + 8 = 0.
"
My notes: Fine.
Task #2: "Colourful Number
Write a script to display all Colorful Number with 3 digits.
A Colorful Number is an integer where all the products of consecutive
subsets of digit are different.
For example, 263 is a Colorful Number since 2, 6, 3, 2x6, 6x3, 2x6x3 are unique.
"
My notes: Interesting.
Having written this, assuming that it's correct, I find 328 Colourful 3-digit
numbers.
|