Loading Super Carl
Super Carl logo Super Carl Get Started
RK

Public post

Rahul Kumar Gupta

Sep 2026 • linkedin

Post excerpt

⚡ 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…

0 reactions • 0 comments

#Algorithms#CompetitiveProgramming#BitManipulation#ComputerScience#SoftwareEngineering#Linkedin
Original post ↗

Find the people and context behind this post

Sign up for Super Carl to explore relationship context, warm paths, and relevant opportunities.

Get started
Logging out…Taking longer than expected. Reload page
Skip to main content
↻