1. We can see that a binary stream containing flag is given to us .2. But the trailing bits and the starting bits were missing. As we know that 1 byte = 8 bits therefore we can check after how many initial bits proper bytes are there( which came out to be after initial bits . 3. To check for proper final bits i took the length of whole binary stream and sliced its first bits . After that , i took out the length of the stream and took its modulus with 8 (  which came out to be 6) so our proper byte stream would be original_stream[2:-6]. After decoding it we get the flag in it. 