Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
yanglbme authored Jul 22, 2025
commit f098f2914f244fb24694b193872200b232fca89d
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ tags:
#### Python3

```python

class Solution:
def maxProduct(self, s: str) -> int:
n = len(s)
Expand Down Expand Up @@ -103,13 +102,11 @@ class Solution:
suffix[~i] = max(suffix[~i], suffix[~i + 1])

return max(prefix[i - 1] * suffix[i] for i in range(1, n))

```

#### Java

```java

class Solution {
public long maxProduct(String s) {
int n = s.length();
Expand Down Expand Up @@ -163,13 +160,11 @@ class Solution {
return P;
}
}

```

#### C++

```cpp

class Solution {
public:
long long maxProduct(string s) {
Expand Down Expand Up @@ -207,13 +202,11 @@ public:
return res;
}
};

```

#### Go

```go

func maxProduct(s string) int64 {
n := len(s)
hlen := make([]int, n)
Expand Down Expand Up @@ -271,21 +264,6 @@ func maxProduct(s string) int64 {

return res
}

func max(a, b int) int {
if a > b {
return a
}
return b
}

func min(a, b int) int {
if a < b {
return a
}
return b
}

```

<!-- tabs:end -->
Expand Down
Loading