Read two lines, each a JSON array of integers. Merge them with spread syntax, remove duplicates with a Set, and print the result as a JSON array preserving first-seen order.
Input: two lines, each a JSON array. Output: one JSON array.
Your program reads from stdin and prints to stdout.
Example 1
Input: [1,2,3] [3,4,5]
Output: [1,2,3,4,5]
Hints
Read two lines, each a JSON array of integers. Merge them with spread syntax, remove duplicates with a Set, and print the result as a JSON array preserving first-seen order.
Input: two lines, each a JSON array. Output: one JSON array.
Your program reads from stdin and prints to stdout.
Example 1
Input: [1,2,3] [3,4,5]
Output: [1,2,3,4,5]
Hints