class Solution {
public:
int integerBreak(int n) {
if(n==2)
return 1;
if(n==3)
return 2;
int product=1;
while(n>4)
{
product*=3;
n-=3;
}
return product*n;
}
};
343. Integer Break
最新推荐文章于 2023-11-30 21:34:08 发布