

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
coding question, it contains the question which was asked for one of the daily challenge
Typology: Lecture notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


19/06/2019 skillrack.com/faces/candidate/dailychallenge.xhtml?k=DC
skillrack.com/faces/candidate/dailychallenge.xhtml?k=DC 1/
LeaderBoard & Yesterday's Solution(/faces/candidate/leaderboarddailychallenge.xhtml?RT=DAILYCHALLENGE)
ProgramID- 8836 Solved By 0 Users
The program must accept N integers as the input. The program must print the output based on the following conditions.
Boundary Condition(s): 1 <= N <= 100 -10^8 <= Each integer value <= 10^
Input Format: The rst line contains the value of N. The second line contains N integers separated by space(s).
Output Format: The rst line contains either N integers separated by a space or -1 based on the given conditions.
Example Input/Output 1: Input: 7 21 14 11 13 29 24 15
Output: 15 29 13 11 21 14 24
Explanation: The number of odd integers is 5. The number of even integers is 2. Here 5 is greater than 2, so all the odd integers are printed in reverse order followed by all the even integers in the given order. Hence the output is 15 29 13 11 21 14 24
Example Input/Output 2: Input: 4 -12 45 78 -
Output: -23 78 45 -
Daily Challenge SkillRack
Ambiance
19/06/2019 skillrack.com/faces/candidate/dailychallenge.xhtml?k=DC
skillrack.com/faces/candidate/dailychallenge.xhtml?k=DC 2/
Save Run