Over the past few weeks, I’ve been working hard to get better at algorithms while working on projects and studying for interviews. I’ve encountered a few helpful strategies along the way, and wanted to share them with the world!

Here are some of the big ones that I’ve seen:

These patterns won’t help you solve every problem you’ll face, but they can improve your chances significantly. This article will cover the first three: frequency counter, multiple pointers, and sliding window. First, let’s talk about…

FREQUENCY COUNTER PATTERN

The frequency counter pattern is most useful in problems where you have multiple pieces of data/inputs to compare. For example, you might be trying to see if two inputs consist of similar values, are anagrams of one another, or if one value is contained inside the other. The frequency counter pattern can reduce the time complexity of your algorithm to O(n) instead of O(n²).

#problem-solving #pattern-recognition #algorithms #javascript

Problem Solving Patterns to know JavaScript
4.10 GEEK