a Bitset data structure compactly store bitsimplement Bitset classbitsetint size Initializes Bitset size bit 0void fixint idx Updates value bit index idx 1 if value 1 change occursvoid unfixint idx Updates value bit index idx 0 if value 0 change occursvoid flip Flips value bit Bitset in word bit value 0 value 1 vice versaboolean check value bite Bitset 1 return true satisfie condition false otherwiseboolean Checks bit Bitset value 1 return true satisfie condition false otherwiseint count Returns total number bit Bitset value 1string tostre return current composition Bitset Note resultant string character ith index coincide value ith bit Bitset Example 1inputbitset fix fix flip unfix flip unfix count tostring5 3 1 0 0 outputnull null null null false null null true null 2 01010ExplanationBitset bs new Bitset5 bitset 00000bsfix3 value idx 3 update 1 bitset 00010bsfix1 value idx 1 update 1 bitset 01010 bsflip value bit flip bitset 10101 bsall return false value bitset 1bsunfix0 value idx 0 update 0 bitset 00101bsflip value bit flip bitset 11010 bsone return true 1 index value 1bsunfix0 value idx 0 update 0 bitset 01010bscount return 2 2 bit value 1bstostring return 01010 composition bitset Constraints1 size 1050 idx size 1At 105 call total fix unfix flip count toStringAt count tostringat 5 call tostre