Hacker News new | ask | show | jobs
by anotherpaulg 1042 days ago
I tried using aider to work with GPT-4 on this problem. Initially it went for a solution based on `shift`. But when challenged, it realized that shift was O(n) and was able to come up with a dual stack solution. It considers this solution O(1) when amortized over many operations. I don't know ruby well, so I can't verify that.

https://aider.chat/share/?mdurl=https://gist.github.com/paul...