Skip to content

Commit 866b3d2

Browse files
committed
feat: add weekly contest 499
1 parent 92ac34b commit 866b3d2

42 files changed

Lines changed: 1853 additions & 11 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

solution/0300-0399/0396.Rotate Function/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ func maxRotateFunction(nums []int) int {
141141
ans := f
142142
for i := 1; i < n; i++ {
143143
f = f + s - n*nums[n-i]
144-
if ans < f {
145-
ans = f
146-
}
144+
ans = max(ans, f)
147145
}
148146
return ans
149147
}

solution/0300-0399/0396.Rotate Function/README_EN.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ func maxRotateFunction(nums []int) int {
139139
ans := f
140140
for i := 1; i < n; i++ {
141141
f = f + s - n*nums[n-i]
142-
if ans < f {
143-
ans = f
144-
}
142+
ans = max(ans, f)
145143
}
146144
return ans
147145
}

solution/0300-0399/0396.Rotate Function/Solution.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ func maxRotateFunction(nums []int) int {
77
ans := f
88
for i := 1; i < n; i++ {
99
f = f + s - n*nums[n-i]
10-
if ans < f {
11-
ans = f
12-
}
10+
ans = max(ans, f)
1311
}
1412
return ans
15-
}
13+
}

solution/3900-3999/3908.Valid Digit Number/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: 简单
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3900-3999/3908.Valid%20Digit%20Number/README.md
5+
rating: 1319
6+
source: 第 181 场双周赛 Q1
57
---
68

79
<!-- problem:start -->

solution/3900-3999/3908.Valid Digit Number/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Easy
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3900-3999/3908.Valid%20Digit%20Number/README_EN.md
5+
rating: 1319
6+
source: Biweekly Contest 181 Q1
57
---
68

79
<!-- problem:start -->

solution/3900-3999/3909.Compare Sums of Bitonic Parts/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3900-3999/3909.Compare%20Sums%20of%20Bitonic%20Parts/README.md
5+
rating: 1408
6+
source: 第 181 场双周赛 Q2
57
---
68

79
<!-- problem:start -->

solution/3900-3999/3909.Compare Sums of Bitonic Parts/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3900-3999/3909.Compare%20Sums%20of%20Bitonic%20Parts/README_EN.md
5+
rating: 1408
6+
source: Biweekly Contest 181 Q2
57
---
68

79
<!-- problem:start -->

solution/3900-3999/3910.Count Connected Subgraphs with Even Node Sum/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3900-3999/3910.Count%20Connected%20Subgraphs%20with%20Even%20Node%20Sum/README.md
5+
rating: 1859
6+
source: 第 181 场双周赛 Q3
57
---
68

79
<!-- problem:start -->

solution/3900-3999/3910.Count Connected Subgraphs with Even Node Sum/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3900-3999/3910.Count%20Connected%20Subgraphs%20with%20Even%20Node%20Sum/README_EN.md
5+
rating: 1859
6+
source: Biweekly Contest 181 Q3
57
---
68

79
<!-- problem:start -->

solution/3900-3999/3911.K-th Smallest Remaining Even Integer in Subarray Queries/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3900-3999/3911.K-th%20Smallest%20Remaining%20Even%20Integer%20in%20Subarray%20Queries/README.md
5+
rating: 2155
6+
source: 第 181 场双周赛 Q4
57
---
68

79
<!-- problem:start -->

0 commit comments

Comments
 (0)