Now that I'm a "proper" software engineer (still ML focused), it's time to bite the bullet and learn some C++. I'll try and add summaries as I go along, as well as lessons learned.
- Libcurl required inside of lib folder.
- clang-format and cmake installed.
- Templates are useful
- Methods are unintuitively named coming from Python
- Back inserter is a thing
- Nothing learned here, just disappointed in myself. After all the LC this year and I still screw up basic edge cases. Nested conditionals not pretty either.
- Thank god regex is in the standard library as of C++11
- Iterators can be more efficient doing left increment instead of right increment, because i++ reconstructs a temporary variable. For primitives this isn't a problem, but for more complex iterators it can lead to slowdown.
- Tuples/pairs are not hashable - need to declare a function.
- Vector of tuples don't have a default constructor so are more verbose to create
- Hacky. Should be more efficient than this but brute force still works.
- Brute force ftw.
Never assume input can be parsed into hashmap. Ended up with hash collision that I missed for hours wondering why things weren't working. Iterative solution with bitmask was interesting but would've been bad for part 2.
Good food.
I hate my life. Why do I torture myself like this.
Redemption.
Thought was DP. Then used hashmap. Was not DP.
Interesting. Leetcode prepared me well for this.
Maths degree going in bin. Also precision go brrr.
Mod doesn't work properly in C++. Fun printing stuff.
NEED TO STOP TRYING TO DO TWO THINGS IN THE SAME LINE OF CODE. Mutation nightmare, state passing nightmare.
Who needs time complexity when you've got C++.