leetle

Daily challenge for 2025-11-09

313. Sort Array By Parity

Given an integer array nums, move all the even integers to the beginning of the array followed by all the odd integers.

Return any array that satisfies this condition. The relative order within even and odd numbers should be preserved.

Example:
Input: nums = [3,1,2,4]
Output: [2,4,3,1]

Example 2:
Input: nums = [0]
Output: [0]

Run this challenge interactively in Python or JavaScript when the app loads.