Approach hintTry it first, then revealHide
Scan from left to right and occupy a free table whenever no occupied table lies within distance k on either side; taking the earliest valid table never hurts later choices.
Scan from left to right and occupy a free table whenever no occupied table lies within distance k on either side; taking the earliest valid table never hurts later choices.