This is an interview question.
Let's say you have such an array
{54,23,545,65,23,4,1,2,5}
How to sort and classify as odd or even in one line of code?
The complexity response order should be O (1), without using a for loop. The result should be:
{2,4,54,1,5,23,23,65,545}
source share