Problem 2834 · Medium

Find the Minimum Possible Sum of a Beautiful Array

Greedily take the smallest positive values, skipping any whose partner that sums to the target is already taken.

Open the interactive visualisation