I just try to let ChatGPT to do the leetcode contest 332. Here is the result
5814

Q1: I input the problem statement and all the test cases, here is the chatGPT response.
image
image

Bingo, chatGPT solve Q1

Q2: The chatGPT sort this array and implement a two pointer solution, here is the code written by chatGPT.
image

This solution is wrong, so I correct him and provide him more testcase, here is the new code.
image

Still wrong, after pointing out, he finally give me an correct brute force solution.
image

I try to let him give a better complexity, he just give me previous wrong code, so I give up.

The result of Q2: failed.

For Q3: The chatGPT try to give me a trie solution, I try to let him give up trie, and he output the result below, which still fails the first test case.

image

Q3: failed

For Q4: The chatGPT give the code below
image

Which is totally wrong, no matter how I correct, he still produce the same code for me.

Q4: failed

Final result: solve Q1 in 10 seconds response time without any penalty , and failed all the other problem, he should be 3 point with time 10 seconds, which give him a final ranking of 7012 of 24000 contestants.

The chatGPT beat over 70% contestants.

Comments (13)