I added to the gist, the optimized function provided by "Mihail Malostanidis" (dev.to/qm3ster) since it is way more "clean". I leaved the old one so you can compare with my first attempt and see the difference. You can always check Mihail comments on this post since he explains his approach to this.
Big thanks to Mihail for his help!!! :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I added to the gist, the optimized function provided by "Mihail Malostanidis" (dev.to/qm3ster) since it is way more "clean". I leaved the old one so you can compare with my first attempt and see the difference. You can always check Mihail comments on this post since he explains his approach to this.
Big thanks to Mihail for his help!!! :)