You are required to perform operations on a binary number represented as a string. The operations consist of inverting bits within a specified range and querying the value of individual bits.
Operations
You will be given a list of operations that can be of two types:
Invert Operation:
Format: ['I', i, j]
Description: Invert the bits from the i-th to the j-th position (inclusive), where the most significant bit (MSB) is at position 1.
Query Operation:
Format: ['Q', i]
Description: Return the value of the i-th bit (either 0 or 1).