Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I gave it two tries, GPT-4 was much better in both cases. Tried with two Leetcode questions. It came back with an empty response for one, and provided a worse code (O(n2) solutions when it can be done with linear time) for the other one.

GPT-4 on the other hand provided a good answer for both questions. Also I guess the UI is buggy w.r.t code formatting, it things the following line is a code and switches to a code block.

``` You are given an array prices where prices[i] is the price of a given stock on the ith day. ```

The only downside for GPT-4 for me right now, is its slowness.



GPT-4 has ingested all of Leetcode, you can literally just type "leetcode 100 python" and it will regurgitate a response for you.

Only exception I found is with some of the Leetcode Premium questions, you might have to actually type in the problem statement, but it's still very likely that multiple solutions have been ingested from GitHub and elsewhere.


I suggest you try enabling "Ignore search results" from the model dropdown for these types of questions. The web results can be distracting for the model for Leetcode-type questions.


I see you've had to suggest this a few times in this thread, and in my experience I would agree with the suggestion. I wonder if you can have a simple gpt model decide automatically when ignoring search results would improve the result and do it automatically.


Interesting idea.


I tried with that option enabled and now it can't generate code at all. Here's my prompt:

``` You are given an array prices where prices[i] is the price of a given stock on the ith day.

Find the maximum profit you can achieve. You may complete at most two transactions.

Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

Write Python code to solve this: def maxProfit(self, prices: List[int]) -> int: ```

Output:

``` It seems like you want to find the maximum profit that can be achieved by buying and selling stocks, with the constraint that you can only make at most two transactions. Is that correct?

Could you please provide some example input and output to help me better understand your requirements? ```

I also tried a more basic prompt, but the output is not what I'd consider good code.

Can you maybe share some examples where we can see how it exceeds GPT-4's capabilities? Thanks!



In my own RAG implementations in the industrial sector, I've found it effective to first have the AI decide whether it needs to search at all. If it doesn't, the answers are much better.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: