I have tried following.
S -> AB A -> 0A1|01 B -> 0B1|01
Are there better way to do it? Thanks
Your grammar allows $S\to AB\to 01B\to 010B1\to 010011\notin L$, and it does not allow $S\to \epsilon$, for example. How about $$ S\to 0S1\mid A,\qquad A\to 1A0\mid \epsilon$$ ?
Copyright © 2021 JogjaFile Inc.
Your grammar allows $S\to AB\to 01B\to 010B1\to 010011\notin L$, and it does not allow $S\to \epsilon$, for example. How about $$ S\to 0S1\mid A,\qquad A\to 1A0\mid \epsilon$$ ?