Share some thought process about this problem
If we want to break a number, breaking it into 3s turns out to be the most efficient.\n    2^3 < 3^2\n    4^3 < 3^4\n    5^3 < 3^5\n    6^3 < 3^6\n    ...\n    
    If we want to break a number, breaking it into 3s turns out to be the most efficient.\n    2^3 < 3^2\n    4^3 < 3^4\n    5^3 < 3^5\n    6^3 < 3^6\n    ...\n    \n    Therefore, intuitively, we want as many 3 as possible \n    if a number % 3 == 0, we just break it into 3s -> the product is Math.pow(3, n/3)\n\n    As for numbers % 3 == 1, we don't want the 'times * 1' in the end; \n        borrowing a 3 is a natural thought. \n        if we borrow a 3, 3 can be divided into \n             case 1: 1 + 2 -> with the extra 1, we have 2*2 = 4\n             case 2: (0) + 3 -> with the extra 1, we have 4\n             turns out these two cases have the same results\n        so, for numbers % 3 == 1 -> the result would be Math.pow(3, n/3-1)*4\n\n    Then we have the numbers % 3 == 2 left\n         again, we try to borrow a 3,\n             case 1: 1+2 -> with the extra 2, we have 1*5 or 3*2 => 3*2 is better\n             case 2: 0+3 -> with the extra 2, we have 2*3 or 5 => 2*3 is better\n         and we actually just end up with not borrowing at all! \n         so we can just *2 if we have an extra 2 -> the result would be Math.pow(3, n/3)*2\n\n    Then, we have a couple corner cases two deal with since so far we only looked at \n    numbers  that are larger than 3 -> luckily, we only have 2 and 3 left, \n    which are pretty easy to figure out\n    \n    Thus my final solution is \n\n    public class Solution {\n        public int integerBreak(int n) {\n            if(n <= 3) return n-1; //assuming n >= 2\n            return n%3 == 0 ? (int)Math.pow(3, n/3) : n%3 == 1 ? (int)Math.pow(3, n/3-1)*4 : (int)Math.pow(3, n/3)*2;\n        }\n    }
['Java']