replaced line 1 with line 2, it ran all test cases while using line 1 it was failing a hidden test case.... So are line 1 and line 2 different functionally?
1. res>=0 ? Console.log(0) : console.log(1)
2. res < 0 ? Console.log(1) : console.log(0)
Which question?
NONNEGPROD Is the code.
I see , even output format seems correct by the lines And the output is deterministic by both lines and same
Ok so i tried problem, and res could be NaN if it was a product of all elements The edge case is there to use more logical approach like counting negative numbers
Обсуждают сегодня