Skip to content

Commit

Permalink
Q1822 added.
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Mar 8, 2023
1 parent 511dd93 commit a900a18
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions E_1822_SignoftheProductofanArray.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Solution {
public int arraySign(int[] nums) {
int ret=1;
for (int num: nums){
if(num==0)
return 0;
if(num<0)
ret= -ret;
}
return ret;
}
}

0 comments on commit a900a18

Please sign in to comment.