Nth Magical Number Leetcode Javascript Practice Programs