How LeetCode adjusts the array order so that odd numbers precede even numbers
This article mainly introduces LeetCode how to adjust the array order to make the odd number in front of the even number, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand it.
Title
Enter an array of integers and implement a function to adjust the order of the numbers in the array so that all odd numbers are in the first half of the array and all even numbers are in the second half of the array.
Example: input: nums = [1rect 2je 3je 4] output: [1meme 3je 2je 4] Note: [3jre 1je 2je 4] is also one of the correct answers. Tip: 1