Sign InCreate Account

Upgrade to Pro

Upgrade Now

Coding Workspace

EditorProjectsPractice QuestionsTimed Mock ExamsFlowcharts

PseudoEditor AI

Pseudocode TutorCode GeneratorCode FixerCode Converter
Back to Problems
PreviousNext

Sign in to run tests against edge cases and save your code automatically.

Problem Description

Hard

Merge Two Sorted Arrays

PROSorting & Searching
Merge Algorithm
1D & 2D Arrays
Sorting

Write a program that inputs 3 integers into array `a`, then 3 integers into array `b`. Each array is already sorted in ascending order. Merge them into a single array of 6 values that is also in ascending order, **without sorting the combined array**: repeatedly compare the next unused value of each array and copy the smaller one across. Output the merged array, one value per line. For example, `a` = 1, 4, 7 and `b` = 2, 3, 9 produce 1, 2, 3, 4, 7, 9.

Example Input

1 4 7 2 3 9

Example Output

1 2 3 4 7 9

Success Rate:

0% (0 passed / 0 attempted)

Code

Draft auto-saved

Test Results

Click "Test Code" to evaluate your code against the tests.

Product

For SchoolsOverviewFeaturesFAQ
PseudoEditor

© 2026 PseudoEditor. All rights reserved.