Sherlock and Array

  • + 1 comment

    I can see that the code passes the test cases, but you still have Undefined Behavior for accessing an out of bounds index. a[-1] where a is an array is always undefined behavior. It means anything can happen, including your program appearing to behave correctly.