match parenthesis program completed without using stack