diff --git "a/problems/0343.346円225円264円346円225円260円346円213円206円345円210円206円.md" "b/problems/0343.346円225円264円346円225円260円346円213円206円345円210円206円.md" index cba82f6cae..2e17caf553 100644 --- "a/problems/0343.346円225円264円346円225円260円346円213円206円345円210円206円.md" +++ "b/problems/0343.346円225円264円346円225円260円346円213円206円345円210円206円.md" @@ -469,6 +469,34 @@ object Solution { } ``` + +### PHP +```php +class Solution { + + /** + * @param Integer $n + * @return Integer + */ + function integerBreak($n) { + if($n == 0 || $n == 1) return 0; + if($n == 2) return 1; + + $dp = []; + $dp[0] = 0; + $dp[1] = 0; + $dp[2] = 1; + for($i=3;$i<=$n;$i++){ + for($j = 1;$j <= $i/2; $j++){ + $dp[$i] = max(($i-$j)*$j, $dp[$i-$j]*$j, $dp[$i]); + } + } + + return $dp[$n]; + } +} +``` +