Follow up:
I tried a difference solution with better runtime and got accepted. I guess the root cause here is no actual test case would run unless my solution passes the performance testing (regardless of the correctness).
Original message:
LC Team,
My submission for Q1218 got TLE with 0/38 test cases passed:

When I ran local test all given examples passed without delay:

Can some please take a look?
Thanks,
Shi