Bitset
A set of small integers stored as bits in machine words: member p is bit p%64 of word p/64. Adding, testing and removing are single bitwise operations, and a whole set of 10,000 restaurants fits in 157 words.
Minimal example
words[p/64] |= 1 << (p % 64) // add p
open := words[p/64]&(1<<(p%64)) != 0 // test pLearn this concept
Lesson 2.15 · Bitsets for opening hoursUsed in exercises
Exercise 2.17 · GET /v1/restaurants: open status Exercise 7.10 · Seed the Real Canteen and Operating AccountsRelatedHalf-open interval