Comment by defrost
3 hours ago
Not my specification (drive by third party)
but I do take the view that ( 1, 2, 3, 4, 5, 5, 6 ) is a list of seven values (perhaps the number of dollars in the pockets of seven distinct unique people) and when sorted the output should also have seven items that correspond to the seven input items.
> Also ...
Yeah, that needs tightening up by pastel8739
You need a way to differentiate the two 5s, that isn't present. If you had a list like:
And did a:
Then the duplicate 2s would be fine, because they're no longer duplicates, only duplicate keys. But it would still fail if (2,baz) showed up twice in the source and destination even though we've asked for SORT, not UNIQSORT.
In the cases of
one or both of those might be incorrect ?
( I'm teasing, perhaps )
More seriously,
> You need a way to differentiate the two 5s
As there's no unique filtering or other reduction going on here, there's a permutation chain from input to output.
But that's not in the specification given above. That specification is entirely wrong to specify SORT. It requires no duplicates survive the sorting process.
The specification said
5 is an item in I, and it is present exactly once in S.
and 5 is another item in I, and it's not present in S.
Yes it is, it's right there, between the 4 and the 6.
2 replies →