Search
⌘K
Leetcode 2149. Rearrange Array Elements by Sign
Given an even-length array with an equal number of positive and negative integers, produce a new array that starts with a positive and alternates signs for every consecutive pair while preserving the original relative order among all positives and among all negatives.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.