Is my approach to problem solving correct?

I have done 144 problems Dec- Feb end, flunked Google interview and after a cool down of 4 months I started again. To test my ability to apply, if i solve a problem, I go to Leetcode's suggestion next problem and try to do it...I have come to realize, in a new problem I just cannot come up with the correct approach.

My strategy turns out a total flunk. For example, I did max prod subarray and then Leetcode suggested I do prod subarray < k. I tried my prev method on this next one with tweaks and that would not do, so after 30min I checked a solution - a simple sliding window did it! and hell yeah, I have learnt how to use sliding window...just that the last problem I did was 4 months back..I find this inability to apply my knowledge..what am I missing? Is my approach incorrect?

Not being able to come up with a solution in the right direction breaks me each time..

Comments (1)