4 ms·
You can easily make an O(n) solution without reordering them by using two pointers; one to read numbers and the other to keep track of where to put the next eve
by Klockan 12y ago
You can easily make an O(n) solution without reordering them by using two pointers; one to read numbers and the other to keep track of where to put the next even number.