N Queens II, Valid Parentheses

Exercises from LeetCode, they are both accepted