ForbiddenSum
Mike likes to invent new functions. The latest one he has invented is called ForbiddenSum. Let's consider how it can be calculated: You are given a set S of positive integers. The integers are not necessary distinct. ForbiddenSum of S equals to the minimal non-negative integer, that can't be returned by the algorithm described below: - Choose a random subset S' of S(it can be empty as well);
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start