I know how to solve for m<n but I'm struggling to understand the logic for m>n.
In m<n we push all a's in the stack and when we get b we popped out one a, when the input ends with a stack containing m-n a's the machine should enter the final state
How can I do for m>n....
The intial configuration is the same. But you've got two separate states for reading 'b's:
State B1: I'm popping 'b's, but the stack hasn't been empty.
State B2: I'm popping 'b's, and the stack is empty.
You've read more b's than a's if you're in state B2.