lynhao / day-by-day

每日更新一道算法题
MIT License
0 stars 0 forks source link

排序题目衍生1 #4

Open lynhao opened 5 years ago

lynhao commented 5 years ago

题目: 给定一个非负整数数组A, A中的一半整数是奇数,一半整数是偶数,对数组进行排序,以便当A[i]为奇数时, i也是奇数

输入: [4,2,5,7] 输出: [4,5,2,7] or [2,5,4,7] or [2,7,4,5]

Originally posted by @lynhao in https://github.com/lynhao/day-by-day/issues/3#issuecomment-531490502