Professional Documents
Culture Documents
Merge Two Sorted Lists: Example 1
Merge Two Sorted Lists: Example 1
You are given the heads of two sorted linked lists list1 and list2.
Merge the two lists into one sorted list. The list should be made by splicing together the nodes
of the first two lists.
Example 1:
Example 2:
Example 3:
Constraints:
Example 1:
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]
Example 2:
Input: n = 1
Output: ["()"]
Constraints:
1 <= n <= 8