My LeetCode grinding. Trying to do a problem a day.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

problem.txt 385B

123456789101112131415161718
  1. Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
  2. You may return any answer array that satisfies this condition.
  3. Example 1:
  4. Input: [3,1,2,4]
  5. Output: [2,4,3,1]
  6. The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
  7. Note:
  8. 1 <= A.length <= 5000
  9. 0 <= A[i] <= 5000