For example let say you have an array of {-1,2,-3, 4,- 5, 6, 7} it supposed to return {-1,-3,-5,2,6,7}
public static int[] moveNegatives(int[] value){
int[] newValues = new int[value.length];
int negative = 0;
int positive = 0;
for (int i = 0; i < value.length; i++){
// checking for a negative number
if (value[i] < 0){
newValues[negative] = value[i];
negative++;
}
// if the values is not negative
else{
newValues[positive + 1] = value[i];
positive += 1;
}
}