---
# System prepended metadata

title: Untitled

---

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. 
An input string is valid if: 
1. Open brackets must be closed by the same type of brackets. 
2. Open brackets must be closed in the correct order.

Examples:
`Input: s = "({})"`

`Output: true`

`Explanation: All open brackets are closed in the correct order.`

`Input: s = "([{})]"`  

`Output: false`

`Explanation: ) and ] are closed in the wrong order; ] should have been closed before ) to close the open brackets in the correct order.`

"({)}" -> false

```java=
public boolean question(String s) {
    int close = 0;
    int open = 0;
    
    Array<Character> arr = new ArrayList<>();
    
    
    if (s.charAt(0) == s.charAt(5)) {
        
    }
}

```
