Combinations
medium 20 minCombination problems pick items where order does not matter.
Where it shows up
The same pattern appears across everyday software.
Test case generation
Pairwise and k-wise testing pick combinations of configuration options (browser, OS, locale) so every pair of settings is covered without running all of them. Tools enumerate combinations and prune ones that break a constraint, just like the start-index search.
Making change and budgeting
Listing every way to pay an amount with given coin values, or every basket that fits a budget, is Combination Sum. Point-of-sale and expense tools use the same search, often with a cap on the number of items.
Feature selection in machine learning
Exhaustive feature selection tries every subset of k features from n and scores a model on each. Because C(n, k) explodes, practitioners prune with bounds or switch to greedy forward selection once n grows past a few dozen.
Phone keypads and predictive text
Old T9 typing mapped each digit to its letters and matched the letter combinations against a dictionary. A trie lets the search stop as soon as a prefix is not a word, which is pruning on the phone-letters tree.
Lottery odds and card games
Choosing 6 numbers from 49 has C(49, 6) = 13,983,816 outcomes, which is where lottery odds come from. Poker solvers enumerate the combinations of remaining cards to compute exact win probabilities.