EX:
n = 3,
[
"((()))", "(()())", "(())()", "()(())", "()()()" ]
"((()))", "(()())", "(())()", "()(())", "()()()" ]
Output: 1->1->2->3->4->4
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Note that an empty string is also considered valid.
EX:
Input: "()[]{}"
Output: true
Input: "([)]"Output: false
Given a linked list, remove the n-th node from the end of list and return its head.
EX:
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the linked list becomes 1->2->3->5.
Note:
Given n will always be valid.
Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].Ans: [ [-1, 0, 0, 1], [-2, -1, 1, 2], [-2, 0, 0, 2] ]
[Ans: [-1, 0, 1], [-1, -1, 2] ]
Output: "fl" Input: ["dog","racecar","car"] Output: "" Explanation: There is no common prefix among the input strings.
Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000
Input: "III" Output: 3
Input: "IV" Output: 4
Input: "IX" Output: 9
Input: "LVIII" Output: 58 Explanation: L = 50, V= 5, III = 3.
Input: "MCMXCIV" Output: 1994 Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
'.' Matches any single character. '*' Matches zero or more of the preceding element.
The matching should cover the entire input string (not partial).
Note:
s could be empty and contains only lowercase letters a-z.p could be empty and contains only lowercase letters a-z, and characters like . or *. inorder = [9,3,15,20,7]3 / \ Ans: 9 20 / \ 15 7