Got runtime error but was able to compile on c++ online compiler

  • 0

    I ran into a situation where it returned runtime error, so I figured might be something wrong with my code(I am aware that my code is not the optimal solution), but when I tried with online compiler I was able to get the expected result and execution seems correct to me, am I doing something wrong or is this an issue with the leetcode compiler?

    Code snippet:

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.