DSA SheetLesson · no judge

CODE DRILL 1 · RUN ONLY

Write it, run it, read the output

This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.

TASK

Use std::sort and a comparator to transform the array [7, 2, 4, 1, 6, 3] so that even numbers come first and odd numbers come second, with each group in ascending order. Print the resulting array in the format [2, 4, 6, 1, 3, 7].

C++
Loading editor…

OUTPUT

Sample
[2, 4, 6, 1, 3, 7]

What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.

Next part · Code drill 2