Search
⌘K

Leetcode 2166. Design Bitset

Design a Bitset class supporting fix, unfix, flip, all, one, count, and toString on a fixed-size bit array. The key challenge is to implement flip and the queries efficiently (e.g., O(1) per op) by using a lazy inversion flag and tracked counts instead of flipping every bit.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.