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.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.