0

Can i remove a negative number by using ArrayList.

I want the product of an array number not to be a negative number. About this problem I split it in 2 situations 1: if total of array number have an zero number and we no need to do anything. The output is zero 2: if a product of number may be positive or negative. - if positive, we no need to remove anything just like one situation. - if negative and total of negative number %2==0, the output is zero . In contrast, the total of negative number %2 != 0 , all we need is just remove one element

25th Sep 2022, 1:57 PM
Nguyen Thi Thao
Nguyen Thi Thao - avatar
3 ответов
+ 1
I'd like to understand this problem a little better. If array is [1, 2, -3, 4] Multiplying them together would give -24. Would you like this number to be 24? (positive instead of negative) Or would you like to filter the array so it becomes [1, 2, 4]
25th Sep 2022, 3:10 PM
Apollo-Roboto
Apollo-Roboto - avatar
0
I ' d like a second . can you help me
29th Sep 2022, 7:20 AM
Nguyen Thi Thao
Nguyen Thi Thao - avatar
0
Do you have an example input = ? expected output = ?
29th Sep 2022, 7:01 PM
Apollo-Roboto
Apollo-Roboto - avatar