Is the language $L = \{0^m1^n: m \neq n - 1 \}$ context free? Consider the language: $L = \{0^m1^n : m \neq n - 1 \}$ where $m, n \geq 0$
I tried for hours and hours but couldn't find its context free grammar. I was stuck with a rule which can check on the condition $m \neq n - 1$. Would anyone can help me out? Thanks in advance.

we have 3 basic ways to check if a grammar is CFL,


*

*draw a PDA

*pumping lemma

*get a stack, and check if by 2 operations(push/pop) u can achieve the target


I will go with the stack method here,
we need 0 or more 0s followed by 0 or more 1s, given that no of 0s should not be 1 less than the no of 1s.
Sol:-


*

*try pushing as many 0s as you get.

*once you receive 1, start popping the 0s(if any)

*at the end of the input,
if there exists a single 0 in the stack, reject the string
else, accept the string.
