Sort 5 multiples in ascending order using java
For this challenge, you will be given an array and you are asked to find multiples of 5 in the given array, sort and put them first in the array. Rest all the elements will preserve their orders.
Input Format -
you will be taking a number as an input from STDIN which tells about the length of the array. On another line, array elements should be there with single space between them.
Output Format -
print the required array to the STDOUT.
Sample Test Case:
Sample Input:-6
9 14 15 10 8 5
Sample Output -
5 10 15 9 14 8
Input Format -
you will be taking a number as an input from STDIN which tells about the length of the array. On another line, array elements should be there with single space between them.
Output Format -
print the required array to the STDOUT.
Sample Test Case:
Sample Input:-6
9 14 15 10 8 5
Sample Output -
5 10 15 9 14 8
Comments
Post a Comment