@HarryChaoyangHe You're brilliant! I have only read your template portion and did not even look at the solutions for the specific problems. Then, I went ahead and applied your template to all the questions you mentioned and was able to solve them in a very short amount of time, mostly writing bug-free code. Thank you so much for the very useful post.
Find All Anagrams in a String