I was browsing the code from this forum thread and noticed the implementation provided by "fxu" here: https://leetcode.com/forums/viewtopic.php?f=4&t=109&sid=1af193882cc708144ee95c035f92d547
I tried it out and it got accepted but there is at least this case where list = [1,0,3,0] judged by the algorithm to be a palindrome wrongly.
Guess this indicated an imperfect set of test cases.
Thanks for your attention.
yeah I did get your point here. the thing is we should have the assumption that the test cases are complete enough for judging our answers right? in another words, we need absolute 0 failure chance.
I solve puzzles for fun not for practicing interview questions. In the original post I said you can use this framework to test your "Ren Pin". My solution does have false positive. However, in the real world an algorithm doesn't have to be soundness (no false negative) or completeness (no false positive). For example, bloom filter is false positive but is widely used.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.