func (sba *sparseBitArray) ClearBit(k uint64) error {
	index, position := getIndexAndRemainder(k)
	i := sba.indices.get(index)
	if i == -1 {
		return nil
	}
	sba.blocks[i] = sba.blocks[i].remove(position)
	if sba.blocks[i] == 0 {
		sba.blocks.deleteAtIndex(i)
		sba.indices.deleteAtIndex(i)
	}
	return nil
}
ClearBit clears the bit at the given position.
package bitarray
import "sort"
type uintSlice []uint64
func (u uintSlice) Len() int64 {
	return int64(len(u))
}
func (u uintSlice) Swap(i, j int64) {
	u[i], u[j] = u[j], u[i]
}
func (u uintSlice) Less(i, j int64) bool {
	return u[i] < u[j]
}
func (u uintSlice) search(x uint64) int64 {
	return int64(sort.Search(len(u), func(i int) bool { return uint64(u[i]) >= x }))
}
func (u *uintSlice) insert(x uint64) (int64, bool) {
	i := u.search(x)
	if i == int64(len(*u)) {
		*u = append(*u, x)
		return i, true
	}
	if (*u)[i] == x {
		return i, false
	}
	*u = append(*u, 0)
	copy((*u)[i+1:], (*u)[i:])
	(*u)[i] = x
	return i, true
}
func (u *uintSlice) deleteAtIndex(i int64) {
	copy((*u)[i:], (*u)[i+1:])
	(*u)[len(*u)-1] = 0
	*u = (*u)[:len(*u)-1]
}
func (u uintSlice) get(x uint64) int64 {
	i := u.search(x)
	if i == int64(len(u)) {
		return -1
	}
	if u[i] == x {
		return i
	}
	return -1
}
type blocks []block
func (b *blocks) insert(index int64) {
	if index == int64(len(*b)) {
		*b = append(*b, block(0))
		return
	}
	*b = append(*b, block(0))
	copy((*b)[index+1:], (*b)[index:])
	(*b)[index] = block(0)
}
func (b *blocks) deleteAtIndex(i int64) {
	copy((*b)[i:], (*b)[i+1:])
	(*b)[len(*b)-1] = block(0)
	*b = (*b)[:len(*b)-1]
}
type sparseBitArray struct {
	blocks  blocks
	indices uintSlice
}
func (sba *sparseBitArray) SetBit(k uint64) error {
	index, position := getIndexAndRemainder(k)
	i, inserted := sba.indices.insert(index)
	if inserted {
		sba.blocks.insert(i)
	}
	sba.blocks[i] = sba.blocks[i].insert(position)
	return nil
}
func (sba *sparseBitArray) GetBit(k uint64) (bool, error) {
	index, position := getIndexAndRemainder(k)
	i := sba.indices.get(index)
	if i == -1 {
		return false, nil
	}
	return sba.blocks[i].get(position), nil
}
func (sba *sparseBitArray) ToNums() []uint64 {
	if len(sba.indices) == 0 {
		return nil
	}
	diff := uint64(len(sba.indices)) * s
	nums := make([]uint64, 0, diff/4)
	for i, offset := range sba.indices {
		sba.blocks[i].toNums(offset*s, &nums)
	}
	return nums
}