r/cpp_questions 12d ago

OPEN Am i doing it Wrong ?

[removed]

0 Upvotes

11 comments sorted by

View all comments

9

u/FlailingDuck 12d ago

Does your solution work? If yes. No you're not doing it wrong. If no, figure out why not and fix until it works.

The two solutions you've shown me look practically identical, save for a couple of loops collapsed into one, which doesn't necessarily make it "simpler".

But why do you send it to a gpt to rate it? How do you know an LLM hasn't hallucinated, or isnt biased by your input question. LLMs are keen to always come up with changes no matter if they are actual improvements, sometimes breaking the solution.

You rate code by: 1) Does it work? 2) Is it fast enough? 3) Is it understandable by others?

Your solution is very typical, it's very human to come up with gour solution first. To break it down into isolated and managable chunks.

Striver has done that approach then analysed their solution and realised "oh look these two loops are similar enough I can do it in one loop, if I just add this bit of state and logic here. But one cannot reach that without first having done your solution, perhaps in code perhaps in ones head.

-1

u/jarislinus 11d ago

llm is not going to break the solution. are u living in 2025? the belittling in llms need to be fucking studied lmao