https://www.codingame.com/playgrounds/5422/js-interview-prep-recursion