Skip to content

Commit 5970640

Browse files
refactor 343
1 parent 9c38505 commit 5970640

File tree

1 file changed

+0
-14
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-14
lines changed

src/main/java/com/fishercoder/solutions/_343.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 343. Integer Break
5-
*
6-
* Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.
7-
8-
For example, given n = 2, return 1 (2 = 1 + 1); given n = 10, return 36 (10 = 3 + 3 + 4).
9-
10-
Note: You may assume that n is not less than 2 and not larger than 58.
11-
12-
Hint:
13-
14-
There is a simple O(n) solution to this problem.
15-
You may check the breaking results of n ranging from 7 to 10 to discover the regularities.
16-
*/
173
public class _343 {
184
public static class Solution1 {
195
public int integerBreak(int n) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy