Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Simulate a Bloom Filter

A Bloom filter uses m bits and two hash functions h1(x) = x mod m and h2(x) = (7x + 3) mod m. Process insert x and query x operations. A query prints MAYBE if both bits are set and NO otherwise.

Constraints

1 <= m <= 1000

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.