Unique Sum 2
For any *zero-indexed* sequence $S$ of length $N$, define a function $G(S)$ as follows: $$ G(S) = \prod_{i=0}^{N-1} (S_i + i) $$ If $N = 0$, then $G(S) = 1$, i.e. the empty sequence has a value of $1$. For an array $B$ and a parameter $K$, we also define another function $F(B, K)$ as follows: $$ F(B, K) = \sum G(S) $$ where the summation is taken over all subsequences $S$ of $B$ such that $|S|
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