For those whose code that can pass online judge, try this combination pow(-0.5,-2147483648). My code passes online judge but actually failed in this case. It`s supposed to return INF.
I don't think infinity is defined for integer in both C++ and Java.
You can set it to INT_MAX, but that does not mean it is INF.
I see. Yes both C++ and Java supports +INF for double. Will consider if this test case is worth adding.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.