Check this input.
[ ["a","b"],["b","c"], ["e", "d"] ]
[ ["a","c"],["b","c"],["a","e"],["a","a"],["x","x"], ["e", "e"], ["e", "d"] ]
e/e should be unavailable. because e/d is zero so. e must be zero
I added this at the top of my solution and it still got accepted.
if equations == [ ["a","b"],["b","c"], ["e", "d"] ]: print equations print values print query return -42
I don't believe you that that test case is in the test suite.
@StefanPochmann Yes, but if you run the test by your self, the default output is wrong.
@singku But why would you do that? You already know that that test case is wrong.
@StefanPochmann That means the default solution has a bug, which is misleading.
@singku Or that means if your code was accepted, that doesn't mean your code is correct.
But that's reasonable if e/d is zero. then e/e must be unavailable and the result should be -1.0
It turns out the OJ's output is 1.0. Which is not correct. My point is even if you passed all the test cases and got accepted, that's still a problem here. And I don't think this is an "Invalid" test case
I'd say that
"The input is always valid. You may assume that evaluating the queries will result in no division by zero and there is no contradiction."
does mean that your test case is invalid.
Well, I know what you were saying and probably you know what I mean, but we are on different tracks and will never agree with each other, so just ignore me.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.