3819. Rotate Non Negative Elements
You are given an integer array
numsand an integerk.Rotate only the non-negative elements of the array to the left by
kpositions, in a cyclic manner.All negative elements must stay in their original positions and must not move.
After rotation, place the non-negative elements back into the array in the new order, filling only the positions that originally contained non-negative values and skipping all negative positions.
Return the resulting array.
1 | class Solution { |