problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::design_bitset 命名空间参考

LeetCode 6002. 设计位集 更多...

class  Bitset
 

函数

 TEST (design_bitset, case1)
 

详细描述

LeetCode 6002. 设计位集

函数说明

◆ TEST()

leetcode::design_bitset::TEST ( design_bitset  ,
case1   
)

在文件 leetcode_test.cpp1320 行定义.

1320 {
1321 auto bt = Bitset(5);
1322 bt.fix(3);
1323 bt.fix(1);
1324 bt.flip();
1325 ASSERT_FALSE(bt.all());
1326 bt.unfix(0);
1327 bt.flip();
1328 ASSERT_TRUE(bt.one());
1329 bt.unfix(0);
1330 ASSERT_EQ(2, bt.count());
1331 ASSERT_EQ("01010", bt.toString());
1332 }