I recently started to learn how to code in C++ since I couldn't solve a problem in Python because of TLE. However, sometimes I know the general answer to a problem and how to code it by myself with what I've learned but it can be a bit clunky. I wonder if it's better to code it that way or look at the editorial or somewhere how this could be coded better ?








Solve the problem yourself, then look at cpp users that have smaller solutions. Look at people that write good code and copy their techniques.
The problem is that python can't always directly translate to c++, so you have to rewire your brain to think in a different language. The same concept can be applied to human languages — if you try direct translation — sure you will probably make your point but it will sound broken, and the sentences would be longer on average since you are not using optimized phrasing. Just looking at cool phrases or words won't immediately help unless you are already on an advanced level, so I don't think looking at editorials before solving would help.
That being said, what helped me transition from python to c++ was to code with whatever techniques I already know, and only then try to correct my bad habits with something better. If you already know basic syntax you can get most things done, I would highly recommend to get to know STL containers like std::set and std::map, and once you have that down you are pretty much set to solve most problems under 1600 which should be sufficient for your level. Then it's just a matter of practice and patience.
One more thing I would suggest is to try to use some LLM as your tutor, however, you have to be cautious to do most of the work yourself and only use queries when you would normally use your search engine or open submissions to look at other ACs. You sure can pick up some techniques by fixing your code with some workarounds used by GMs, but it can cause problems later on if you don't know the time complexity or the invariants needed for some technique to be applicable. So try to fully understand something before using it. Good luck learning!
Thank you, I will try applying these tips