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

[pull] main from itcharge:main #23

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
pull merged 13 commits into AlgorithmAndLeetCode:main from itcharge:main
Aug 9, 2022
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit Hold shift + click to select a range
60d8274
Update 0771. 宝石与石头.md
itcharge Aug 8, 2022
006157d
Update 2235. 两整数相加.md
itcharge Aug 8, 2022
ea71e33
Update 1929. 数组串联.md
itcharge Aug 8, 2022
774639b
Update 1480. 一维数组的动态和.md
itcharge Aug 9, 2022
07af991
Create 0709. 转换成小写字母.md
itcharge Aug 9, 2022
3c66bb9
Create 1672. 最富有客户的资产总量.md
itcharge Aug 9, 2022
cf383a0
Update 0066. 加一.md
itcharge Aug 9, 2022
9a7f2dc
Update 0189. 轮转数组.md
itcharge Aug 9, 2022
26b605f
Update 0048. 旋转图像.md
itcharge Aug 9, 2022
efdb7d2
Update 0724. 寻找数组的中心下标.md
itcharge Aug 9, 2022
bb00113
Update 0054. 螺旋矩阵.md
itcharge Aug 9, 2022
75279ea
Update 0498. 对角线遍历.md
itcharge Aug 9, 2022
7aacbc3
更新「Leetcode 刷题课程第一期」内容
itcharge Aug 9, 2022
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 0724. 寻找数组的中心下标.md
  • Loading branch information
itcharge committed Aug 9, 2022
commit efdb7d2288b4b638744cf181d23e13a3e30307b8
7 changes: 6 additions & 1 deletion Solutions/0724. 寻找数组的中心下标.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

两次遍历,第一次遍历先求出数组全部元素和。第二次遍历找到左侧元素和恰好为全部元素和一半的位置。

### 思路 1:两次遍历代码
### 思路 1:代码

```Python
class Solution:
Expand All @@ -47,3 +47,8 @@ class Solution:
return -1
```

### 思路 1:复杂度分析

- **时间复杂度**:$O(n)$。两次遍历的时间复杂度为 $O(2 * n)$ ,$O(2 * n) == O(n)$。
- **空间复杂度**:$O(1)$。

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