Easy one liner O(1) TC javascript solution!! ✔️✔️
Intuition\nBasic implementation\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nBasic post increment n every time when you return i
# Intuition\nBasic implementation\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nBasic post increment n every time when you return it\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(1)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {number} n\n * @return {Function} counter\n */\nvar createCounter = function(n) {\n    return function() {\n        return n++;\n    };\n};\n//Please upvote if you like the solution!!!\u2714\uFE0F\u2714\uFE0F\n```
['JavaScript']