3 ms·
> I regularly see similar problems at work. No way anyone gets that in 30 minutes without having seen it exactly before. Moving pointers in from the sides, acc
by leetthrowaway 5y ago
> I regularly see similar problems at work.
No way anyone gets that in 30 minutes without having seen it exactly before. Moving pointers in from the sides, according to Y height, both at the same time when equal, and then not using that to find the solution, just to narrow the search space? I mean, it's not like I and everyone else didn't think along those lines, but that exact algorithm is totally non-obvious. I spent like 20 minutes on something similar, another 20 on a recursive split/merge thing that went nowhere, then got brute force working.
- jstx1 5y agoThe problems can be solved quickly with training. There’s a limited number of techniques and you develop pattern recognition with practice. Once you get that down it’s about executing well under pressure and communicating your thought process.
- b20000 5y agono, they can be solved quickly by memorizing the optimal solution and training to write the code very quickly. so basically train like a monkey.