def _bit_is_set(bit_str: str, i: int) -> bool:
    """
    Private helper function to check whether the i-th bit in the given bit
    string is set.
    :param bit_str: str
    :param i: int
    :return: bool
    """
    return bit_str[i] == '1'
    # Running time complexity: O(1)