4 ms·
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)
by anotherpaulg 3y 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-gauthier/e3f32d84b9bbc592731bcb9db50f035d https://aider.chat/share/?mdurl=https://gist.github.com/paul...