After experimenting for a while I got the impression that ChatGPT solves a problem first and then tries to find code that may (or may not) produce the same output as its own internal processes of finding the solution