The idea in plain English: Imagine you have a set of items with different weights. The subset sum problem asks: can you pick a subset of items that adds up to a specific target weight? For a general set, this is very hard (exponential time). But if you construct the weights in a special way (called a superincreasing sequence — each weight is bigger than the sum of all previous ones), the problem becomes trivial. This cipher converts each letter's ASCII code into a subset sum target, and you need to figure out which items were selected.
Why this really exists: Merkle-Hellman was one of the FIRST public-key cryptosystems ever invented (1978, right after RSA). It worked by having a "hidden" superincreasing sequence that the owner knew, and a "public" scrambled version that everyone else saw. While it was eventually broken (using lattice reduction), it's a beautiful example of how simple math problems can create powerful encryption. Modern lattice cryptography (like Kyber, the NIST post-quantum standard) is a direct intellectual descendant.
Superincreasing sequence: [2, 3, 6, 13, 27]. Target sum = 18.
Each ASCII character is encoded as a subset sum. The greedy algorithm (start from heaviest, take if it fits) efficiently solves the superincreasing case.
1. Get the knapsack weights and the target sums from puzzle data
2. For each target sum, use the greedy algorithm on the superincreasing sequence
3. Record which items are taken (1) or not (0) as a binary number
4. Convert binary to decimal → ASCII character
5. Join all characters → the answer word