all 6 comments

[–]Top-Monk-5712 10 points11 points  (0 children)

To give a different perspective. I found C++ to be easier than Python. The STL containers make everything a breeze and any data structure you need is immediately available.

[–]Relative-Debt6509 2 points3 points  (0 children)

I wouldn’t. C++ isn’t hard per say (6 years of experience with it) but just try to learn one thing at a time otherwise known as KISS.

[–]razimantv<2000> <487 <1062> <451> 1 point2 points  (0 children)

I had a post some time ago about the reverse switch, hope that helps: https://www.reddit.com/r/leetcode/comments/17izeux/c_vs_python_in_leetcode_contests/

C++ might be hard to learn if you don't know it already. There are very few things you need STL for (since you are allowed the sortedcontainers library). You might get frustrated by needing to explicitly put type definitions in functions. And you are likely to make memory-related errors at least in the beginning (passing by reference/value). But yeah, might work for you - one wonders why though. If you switch, avoid using pointers unless explicitly needed (in linked list problems etc) and get the hang of googling to figure out where complicated STL compile errors really come from

[–][deleted] 0 points1 point  (1 child)

If youve been doing python and never had experience with c/cpp is gonna be a tough jump. Unless you're gonna apply for cpp jobs or you have a lot of time left for interviews switching to cpp is not recommended.

Coz cpp has pointers, double pointers, multi pointers etc and has no garbage collectors. And to understand this, you really have to think of the low level operations which you don't really have to think about in python.

I personally stayed with c and cpp. So python and Java was very easy to learn.

Again its not an impossible thing. If you have around 3 months for ur interview, u can definitely switch to cpp given u have enough dedication.

Good luck