Interview Question locking for Ans

Write a Java Program in below senario :slight_smile:

Example 1:
Input : s ="()";
Output : true
Example 2:
Input: s = “() [] {}”
Output : true
Example 3:
Input : s = “(]”
Output : false
Example 4:
Input : s = “([)]”
Output : fasle
Example 5:
Input : s = “{[] }”
Output : true

The Condition should match s ="()" true condition. or s ="(" should return false … same for other conditions as well

This is balanced parenthesis , brackets matching , google it.