Union of Sorted Arrays Problem
Union of Sorted Arrays Problem — ExecCode School DSA Practice
Solve the Union of Sorted Arrays problem on ExecCode. Free online school DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Given an array of N integers, check whether the array is sorted (non-decreasing) and print the result as shown in the examples. Your task is to understand the rule and print the correct answer. You are working on Union of Sorted Arrays.
Examples
Input 5 3 1 2 3 4 5 2 4 6; Output 1 2 3 4 5 6. Input 3 3 1 2 3 4 5 6; Output 1 2 3 4 5 6
Constraints
1 <= n <= 10^5
Practice Union of Sorted Arrays free on ExecCode. Browse DSA problems, topic map, and placement guides.