Everyone says dont remember solution of problem. But some problems ( even easy ones) have very specific solutions/algorithms. E.g. problem 88 in leetcode. (merge sorted array) Should such solutions be remembered? What do you folks suggest? #google #leetcode #faang #meta #amazon
What do you have to remember in this?
That you have to use 3 pointers… and starting from back ( decreasing) . If that point is missed, it cant be solved in O(m+n)
But that’s very obvious thing. Two arrays so 2 read pointers. And then one write index pointer is obvious. If you start from beginning then you may overwrite the first array unread values. That’s why write from end. Because then no chance of overwriting. I think the only tricky part in the question is to handle case when first array is finished early so you still need to copy second array elements to first array. And if second array is finished earlier, then we are done.
Tech Industry
3d
36120
What happens when most of your team is Indian?
Work Visa
Yesterday
994
Hypocrisy of Indians
Tech Industry
8h
965
Why doesn't OpenAI offshore and reduce expense by 80%
Software Engineering Career
Yesterday
555
If your team does daily standups, your manager is a micromanager
Cars
Yesterday
1032
Tesla ruined whole auto industry
Memorizing is absolutely useless (outside of the base algos / patterns). You have to be able to do it on the fly.