I cannot pass this test case but my answer looks correct to me. I am suspecting there is an off-by-one error in OJ. Does an admin mind checking?
Please see my recent submission for my code if that matters - thanks!
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.