https://medium.com/better-programming/common-javascript-algorithm-interview-questions-explained-68d8c4186270