IMO I think it’s fine as long the submitter understand all their changes. This is easiest done if the submitter writes all the code themselves though.
In this case I would reject this. The submitter doesn’t seem to be qualified to understand the code change, and just let ChatGPT explain the code change for them. ChatGPT is a master in being confidently incorrect.