from typing import List
import io


def generate_binary_strings(n_qubits: int) -> List[str]:
    """Generate all possible binary strings

    Args:
        n_qubits (int): # of qubits

    Returns:
        list: list of binary strings
    """
    global string
    string = io.StringIO()

    def generate_bitstring(n_qubits, bit_string, i):
        """recursively build up bitstring
        """
        if i == n_qubits:
            global string
            s = ''
            print(s.join(bit_string), file=string)
            return
        bit_string[i] = '0'
        generate_bitstring(n_qubits, bit_string, i + 1)
        bit_string[i] = '1'
        generate_bitstring(n_qubits, bit_string, i + 1)

    # recursive call and parse string buffer
    bit_string = [None] * n_qubits
    generate_bitstring(n_qubits, bit_string, 0)
    s = string.getvalue()
    binary_strings = s.split('\n')
    binary_strings.pop()
    return binary_strings