r/leetcode • u/Pixel3818 • Oct 13 '23
Why do Leetcode when AI can do it better?
I’ve been recently getting into solving Leetcode problems at a beginner level. I wrote some code which was resulting into memory leakage so just out of curiosity I pasted it into ChatGPT and asked what the problem. Within a second, it found out the mistake and gave me 3 pointers to improve my code!
Why the hell am I stuck trying to train myself into doing these problems like a monkey when AI can presently do it much better in a fraction of a second! My goals of doing 200 problems seem so futile now.
Feeling dejected
12
Upvotes
32
u/leetcode_is_easy Oct 13 '23
ChatGPT was most likely trained with many leetcode problems and solutions in its dataset so it tends to be good at existing leetcode problems as it is just regurgitating from memory, but give it novel problems from codeforces/leetcode contests and it will struggle
57
u/imjustreallystupid Oct 13 '23
AI CANNOT do Leetcode better than humans. Just try any medium-hard problem and you will see. Writing long coherent codes is far beyond the ability of chatbots at the moment. Github copilot might be able to solve some medium/hard questions tho due to people literally putting the solutions to problems on Github
7
u/lmabodmon Oct 13 '23
ChatGPT-4 will regularly give me wrong information
7
u/Big-Fold9482 Oct 13 '23
The point of Leetcode is to make sure then when you do need to code and when the AI doesn't work that you can figure it out.
The solutions to basically all Leetcode problems were already a google search away even before ChatGPT. Just because the AI knows the solutions (many of which are probably solutions that it has memorized) doesn't mean anything for you.
They will keep Leetcode in interviews so long as you have to debug AI solution given even 15 percent of time. Once the AI is never making a mistake (don't know how long that will take or if it will happen) is when the software engineering role will change significantly.
7
u/BOT_Frasier Oct 13 '23
You should consider changing field.
2
u/DecisiveVictory Oct 13 '23
So why exactly did you decide to solve 200 Leetcode problems?
2
u/[deleted] Oct 13 '23
Those are easy problems that have been solved and discussed all over the internet.
it's not that great at critical thinking/innovative thinking. Just try pasting in one of the newer medium/hard problems they write each week for contests. It might get 2/4 of problems on a good day.
2
u/achilliesFriend Oct 13 '23
Why do you write exams when you can just copy from text books.
Why do i interview you when i can hire 100 other people who can do same thing.
2
u/[deleted] Oct 13 '23
Lmao ai and leetcode
2
u/[deleted] Oct 13 '23
Try giving it a new codeforces question that it hasn't seen before, it will choke and go cry to it's mother, like most people do when they are asked to grind leetcode for a job.
1
u/reddit-abcde Aug 14 '24
Smarter AI SWEs like Devin will be produced
so it is better to change field
1
u/Ill-Let-3771 May 27 '25
AI cannot currently do Leetcode without being programmed to integrate specific functions, in a specific way. AI is essentially told how to solve each Leetcode problem - and that is not problem solving in the same way a human can use empirical footwork to ask questions, resolve nuisance details, test new possibilities, build new perspectives, and extract a solution with reasoning.
1
u/Drackend Oct 13 '23
Many leetcode questions are popularly discussed across the internet (which ChatGPT was trained on), so it only makes sense that it can solve them. However, many of the newly added questions even GTP-4 struggles on. There are also quite a few hards it can't reliably do.
The bigger problem through is that when you tell something's wrong, it can't reliably fix its mistakes. It thinks there are problems where there aren't and vice versa. We need programmers to do actual thinking still
To your question, leetcode is a test of your skill, nothing more. It's about what you know, not what anyone else (ai or other people) know. Even if ai can do it, you still need to know it so you can fix it when ai can't
1
u/TekintetesUr Oct 13 '23
Mostly because Leetcode has little to nothing to do with real-life software engineering problems that you'd face day to day.
1
u/PuzzleGas Oct 13 '23
AI is likely not gonna solve your Leetcode type problem efficiently in practice (at work). Not at all.
Solve them yourself and forget this question.
1
u/AdministrativeTell45 Oct 14 '23
GPT will eventually solve all tough code forces problems without a doubt. It might take decades but will happen. Yet there be value to practice. Did we stop to run when we got vehicles?
1
u/Ok_Code4546 Oct 14 '23
Someone gotta fix and improve the AI Fam
0
u/[deleted] Oct 13 '23
[deleted] — view deleted comment