Marks :10
: 1 | : 1
Given an array $$$A$$$ of $$$n$$$ integers, write a function that segregates even and odd numbers. The function should put all even numbers first then odd numbers.
For now, you should maintain the order of even and odd numbers. For example:
arr = [3, 5, 8, 9, 0]
output = [8, 0,3, 5, 9]
The first line contains an integer $$$n$$$. The next line contains $$$n$$$ integers $$$A_{i}$$$$$$(1 \le n,A_{i} \le 10^5).$$$
Output the array in which the order of even and odd numbers is maintained.
3 1 2 3
2 1 3
4 4 6 4 8
4 6 4 8
6 1 3 7 8 9 5
8 1 3 7 9 5
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.