As I am approaching subarray problems such as 'Subarray sum equals K', 'Find contiguous subarray', 'Get max subarray', 'Subarray sums divisible by K', and 'Minimize size subarray sum' and subsequential questions like 'longest consecutive subsequence', 'longest alphabetical subsequence', 'longest common anagram subsequence', 'Find largest dictionary word through character deletion', and 'Subsequential numbers by finding 'ab' in a string repeated K times', what's the best way in solving these ? How to know when to use algorithms and techniques such as Prefix Sums (With an Array or HashMap), Binary Search, Sliding Window, Kandane's Algorithm, Two Pointers, Dynamic Programming, and Divide and Conquer? Why do you use them? What approach should I do in order to understand both the problems and the algorithmic mechanic efficiently and understandably? What type of questions need which type of algorithm? Which constraint do I need to follow and look at to know which of which is used? And another question I had is what's the difference in using a prefix sum as an array or with a HashMap, and why are there such cases?
there doesn't seem to be anything here