Math Approach "0 ms" O(1) No DP 🏁🏁
Approach\nMath div to only 2\'s and 3\'s\n# Complexity\n- Time complexity:\nO(1)\n\n- Space complexity:\nO(1)\n\n# Corner Test Case\nHandling the left overs unu
# Approach\nMath div to only 2\'s and 3\'s\n# Complexity\n- Time complexity:\nO(1)\n\n- Space complexity:\nO(1)\n\n# Corner Test Case\nHandling the left overs unused "ones" to make 2 * 2 instead of 3 * 1\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int integerBreak(int n) \n    {\n        if (n == 2)\n            return 1;\n        if (n == 3)\n            return 2;\n\n        int count3 = n / 3;\n        int modfrom3 = n % 3;\n\n        if (modfrom3 == 1)\n            if (count3)\n                 count3 --;\n\n        n -= ( count3 ) * 3;\n\n        int count2 = n / 2;\n        n-= (n / 2) * 2;\n\n        return pow(3 , count3) * pow(2 , count2);\n        \n    }\n};\n```
['C++']