Tried solving this problem: https://leetcode.com/problems/max-area-of-island/
And I quickly fell into the depths of insanity.
Highlights from my discord rants while trying to solve this problem
- i couldnt just use a set cuz turns out tuples, pairs, and vectors in c++ are ALL unhashable
you need to make a custom hasher - I attempted to hash the position of the current point of the 2D array we were on, only to find that there is no good way to do so. I ended up doing some weird bitshifting to combine two ints into a single long
- I also tried a different method of solving this problem by using a separate 2D array of boolean values to indicate if we had searched through that position yet, only to find it its apparently really really hard to pass in a 2D array of variable rows and columns as a parameter into a recursive function without extremely ugly templating
Also, I should mention I gave up halfway through and attempted to port Neetcode's solution from python into c++ only to end up in implementation hell.
All in all, I don't really like c++ very much. It's probably the least fun language I've ever used, and I had to use Pascal for three years during middle school.
