For instance, I asked ChatGPT to implement the greedy peeling algorithm for densest subgraph (a.k.a. Charikar's algorithm). The output was correct but the algorithm did not run in linear time. Then I prompted it to add the data structures for making it run in linear time and it just failed.
Comments
https://claude.site/artifacts/d9c4a5f0-42c4-4852-a5a7-bef059201837
I did not play much with the prompt.