In a given array, I need to find the index of the minimum value in an array, but only if it is negative.
For example : [1, 2, 3, 4]
would return no indices
and [1, 4, -7, -2]
would return 3
I was thinking that it must be simple with the find()
command, but I couldn't figure out how to use it for this specific situation.