Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add new lc problems #4718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
yanglbme merged 1 commit into main from dev
Sep 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion solution/3600-3699/3673.Find Zombie Sessions/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tags:

<pre>
+------------------+----------+
| Column Name | Type |
| Column Name | Type |
+------------------+----------+
| event_id | int |
| user_id | int |
Expand Down
2 changes: 1 addition & 1 deletion solution/3600-3699/3673.Find Zombie Sessions/README_EN.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tags:

<pre>
+------------------+----------+
| Column Name | Type |
| Column Name | Type |
+------------------+----------+
| event_id | int |
| user_id | int |
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3674.Minimum%20Operations%20to%20Equalize%20Array/README.md
rating: 1369
source: 第 466 场周赛 Q1
---

<!-- problem:start -->
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3674.Minimum%20Operations%20to%20Equalize%20Array/README_EN.md
rating: 1369
source: Weekly Contest 466 Q1
---

<!-- problem:start -->
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3675.Minimum%20Operations%20to%20Transform%20String/README.md
rating: 1414
source: 第 466 场周赛 Q2
---

<!-- problem:start -->
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3675.Minimum%20Operations%20to%20Transform%20String/README_EN.md
rating: 1414
source: Weekly Contest 466 Q2
---

<!-- problem:start -->
Expand Down
2 changes: 2 additions & 0 deletions solution/3600-3699/3676.Count Bowl Subarrays/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3676.Count%20Bowl%20Subarrays/README.md
rating: 1847
source: 第 466 场周赛 Q3
---

<!-- problem:start -->
Expand Down
2 changes: 2 additions & 0 deletions solution/3600-3699/3676.Count Bowl Subarrays/README_EN.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3676.Count%20Bowl%20Subarrays/README_EN.md
rating: 1847
source: Weekly Contest 466 Q3
---

<!-- problem:start -->
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3677.Count%20Binary%20Palindromic%20Numbers/README.md
rating: 2222
source: 第 466 场周赛 Q4
---

<!-- problem:start -->
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3677.Count%20Binary%20Palindromic%20Numbers/README_EN.md
rating: 2222
source: Weekly Contest 466 Q4
---

<!-- problem:start -->
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3678.Smallest%20Absent%20Positive%20Greater%20Than%20Average/README.md
---

<!-- problem:start -->

# [3678. 大于平均值的最小未出现正整数](https://leetcode.cn/problems/smallest-absent-positive-greater-than-average)

[English Version](/solution/3600-3699/3678.Smallest%20Absent%20Positive%20Greater%20Than%20Average/README_EN.md)

## 题目描述

<!-- description:start -->

<p>给你一个整数数组 <code>nums</code>。</p>

<p>返回 <code>nums</code> 中 <strong>严格大于</strong> <code>nums</code> 中所有元素 <strong>平均值</strong> 的 <strong>最小未出现正整数</strong>。</p>
数组的 <strong>平均值</strong> 定义为数组中所有元素的总和除以元素的数量。

<p>&nbsp;</p>

<p><strong class="example">示例 1:</strong></p>

<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">nums = [3,5]</span></p>

<p><strong>输出:</strong> <span class="example-io">6</span></p>

<p><strong>解释:</strong></p>

<ul>
<li><code>nums</code> 的平均值是 <code>(3 + 5) / 2 = 8 / 2 = 4</code> 。</li>
<li>大于 4 的最小未出现正整数是 6。</li>
</ul>
</div>

<p><strong class="example">示例 2:</strong></p>

<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">nums = [-1,1,2]</span></p>

<p><strong>输出:</strong> <span class="example-io">3</span></p>

<p><strong>解释:</strong></p>

<ul>
<li><code>nums</code> 的平均值是 <code>(-1 + 1 + 2) / 3 = 2 / 3 = 0.667</code> 。</li>
<li>大于 0.667 的最小未出现正整数是 3 。</li>
</ul>
</div>

<p><strong class="example">示例 3:</strong></p>

<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">nums = [4,-1]</span></p>

<p><strong>输出:</strong> <span class="example-io">2</span></p>

<p><strong>解释:</strong></p>

<ul>
<li><code>nums</code> 的平均值是 <code>(4 + (-1)) / 2 = 3 / 2 = 1.50</code>。</li>
<li>大于 1.50 的最小未出现正整数是 2。</li>
</ul>
</div>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>

<ul>
<li><code>1 &lt;= nums.length &lt;= 100</code></li>
<li><code>-100 &lt;= nums[i] &lt;= 100</code></li>
</ul>

<!-- description:end -->

## 解法

<!-- solution:start -->

### 方法一

<!-- tabs:start -->

#### Python3

```python

```

#### Java

```java

```

#### C++

```cpp

```

#### Go

```go

```

<!-- tabs:end -->

<!-- solution:end -->

<!-- problem:end -->
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3678.Smallest%20Absent%20Positive%20Greater%20Than%20Average/README_EN.md
---

<!-- problem:start -->

# [3678. Smallest Absent Positive Greater Than Average](https://leetcode.com/problems/smallest-absent-positive-greater-than-average)

[中文文档](/solution/3600-3699/3678.Smallest%20Absent%20Positive%20Greater%20Than%20Average/README.md)

## Description

<!-- description:start -->

<p>You are given an integer array <code>nums</code>.</p>

<p>Return the <strong>smallest absent positive</strong> integer in <code>nums</code> such that it is <strong>strictly greater</strong> than the <strong>average</strong> of all elements in <code>nums</code>.</p>
The <strong>average</strong> of an array is defined as the sum of all its elements divided by the number of elements.
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">nums = [3,5]</span></p>

<p><strong>Output:</strong> <span class="example-io">6</span></p>

<p><strong>Explanation:</strong></p>

<ul>
<li>The average of <code>nums</code> is <code>(3 + 5) / 2 = 8 / 2 = 4</code>.</li>
<li>The smallest absent positive integer greater than 4 is 6.</li>
</ul>
</div>

<p><strong class="example">Example 2:</strong></p>

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">nums = [-1,1,2]</span></p>

<p><strong>Output:</strong> <span class="example-io">3</span></p>

<p><strong>Explanation:</strong></p>

<ul>
<li>​​​​​​​The average of <code>nums</code> is <code>(-1 + 1 + 2) / 3 = 2 / 3 = 0.667</code>.</li>
<li>The smallest absent positive integer greater than 0.667 is 3.</li>
</ul>
</div>

<p><strong class="example">Example 3:</strong></p>

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">nums = [4,-1]</span></p>

<p><strong>Output:</strong> <span class="example-io">2</span></p>

<p><strong>Explanation:</strong></p>

<ul>
<li>The average of <code>nums</code> is <code>(4 + (-1)) / 2 = 3 / 2 = 1.50</code>.</li>
<li>The smallest absent positive integer greater than 1.50 is 2.</li>
</ul>
</div>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
<li><code>1 &lt;= nums.length &lt;= 100</code></li>
<li><code>-100 &lt;= nums[i] &lt;= 100</code>​​​​​​​</li>
</ul>

<!-- description:end -->

## Solutions

<!-- solution:start -->

### Solution 1

<!-- tabs:start -->

#### Python3

```python

```

#### Java

```java

```

#### C++

```cpp

```

#### Go

```go

```

<!-- tabs:end -->

<!-- solution:end -->

<!-- problem:end -->
Loading

AltStyle によって変換されたページ (->オリジナル) /