ChatGPT doesn't understand anything. LLMs ingest zillions of lines of text and learn to complete sentences. They don't know (don't care) what's true. Give ChatGPT a new problem statement and it won't even care if the code it comes up with so