Format JS and TS code.

This commit is contained in:
krahets
2023-09-02 23:07:47 +08:00
parent f96f583771
commit 978857570f
35 changed files with 75 additions and 74 deletions
@@ -5,7 +5,7 @@
*/
/* 最大切分乘积:贪心 */
function max_product_cutting(n) {
function maxProductCutting(n) {
// 当 n <= 3 时,必须切分出一个 1
if (n <= 3) {
return 1 * (n - 1);
@@ -29,5 +29,5 @@ function max_product_cutting(n) {
let n = 58;
// 贪心算法
let res = max_product_cutting(n);
let res = maxProductCutting(n);
console.log(`最大切分乘积为 ${res}`);