Synthesizing 'Duplicate elements' program