Separate Even and Odd Problem

Separate Even and Odd Problem — ExecCode Easy DSA Practice

Solve the Separate Even and Odd problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Separate Even and Odd. Your task is to compute the required answer and return evens then odds, space-separated. n, then n integers.

Examples

Input {"nums": [1, 2, 3, 4, 5]}; Output 2 4 1 3 5. Input {"nums": [2, 4, 6]}; Output 2 4 6. Input {"nums": [1, 3, 5, 7]}; Output 1 3 5 7

Constraints

Stable partition

Practice Separate Even and Odd free on ExecCode. Browse DSA problems, topic map, and placement guides.