THREEDIF problem

I fail to understand the example

2 4 2 output

The output given for 2 4 2 is

Here the triples are:
(1, 3, 2)
(1, 4, 2)
(2, 3, 1)
(2, 4, 1)

Why are the triples like …

3 1 2
3 2 4
2 4 3
1 2 4
1 2 3

are not taken as a triplet.

It is because the (i)th element should lie between 1 and N for that i . This means at first position , the number can range from 1 to 2 (both inclusive) . At second position , the no should be between 1 and 4 . At third position , the number should range from 1 to 2 .

One more thing is triplets like (1,1,1) are not valid because each number should be unique .