to return this value ‘4,5,1,2’ .
Currently my method is looping the array and using modulus operator to get expected index. Any better approach than this?
Can you provide more information, why '4,5,1,2' instead '1,2,4,5'
Create two empty arrays, push into first array all values before needle and all values after into second array. After it merge two arrays.
Обсуждают сегодня