RK
Public post
Rahul Kumar Gupta
Sep 2026 • linkedin
Public post
Sep 2026 • linkedin
⚡ Today's learning: Gosper's Hack — enumerating subsets without recursion Say you need every subset of size k from a set of n elements — a classic combinatorics problem (n choose k subsets). The obvious approach: recursive backtracking, or looping through all 2^n bitmasks and checking which ones have exactly k bits set. Both work, but the second wastes a lot of cycles checking masks you'll immediately throw away. Gosper's Hack does something neater: given your current subset (represented as a bitmask), it computes…
Find the people and context behind this post
Sign up for Super Carl to explore relationship context, warm paths, and relevant opportunities.