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] master from youngyangyang04:master #12

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 18 commits into AlgorithmAndLeetCode:master from youngyangyang04:master
Jun 12, 2022
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8030165
添加 515.在每个树行中找最大值 Scala版本
wzqwtt May 19, 2022
a317949
添加 116.填充每个节点的下一个右侧节点指针 Scala版本
wzqwtt May 19, 2022
7a62a75
添加 117.填充每个节点的下一个右侧节点指针II Scala版本
wzqwtt May 19, 2022
32f0599
添加 104.二叉树的最大深度 Scala版本
wzqwtt May 19, 2022
f5c5a58
添加 111.二叉树的最小深度 Scala版本
wzqwtt May 19, 2022
afcf6cd
添加(0718.最长重复子数组.md):增加typescript版本
xiaofei-2020 May 19, 2022
a4b0247
添加0704.二分查找 Kotlin版本
Mrxulovemingming May 19, 2022
6177934
Merge branch 'youngyangyang04:master' into master
Mrxulovemingming May 21, 2022
3de2992
添加0027.移除元素 Kotlin版本
Mrxulovemingming May 21, 2022
b57842d
Merge branch 'youngyangyang04:master' into master
Mrxulovemingming May 22, 2022
10b440e
添加0977.有序数组的平方 Kotlin版本
Mrxulovemingming May 23, 2022
35666ef
Merge branch 'youngyangyang04:master' into master
Mrxulovemingming May 25, 2022
2b434d0
Merge branch 'master' into master
Mrxulovemingming May 28, 2022
770c230
Merge pull request #1353 from wzqwtt/tree04
youngyangyang04 Jun 11, 2022
8156c35
Merge pull request #1354 from wzqwtt/tree05
youngyangyang04 Jun 11, 2022
0ffffe0
Merge pull request #1355 from xiaofei-2020/dp43
youngyangyang04 Jun 11, 2022
b37c3e0
Merge branch 'master' into master
youngyangyang04 Jun 11, 2022
a6ce79a
Merge pull request #1357 from Mrxulovemingming/master
youngyangyang04 Jun 11, 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
添加0027.移除元素 Kotlin版本
  • Loading branch information
Mrxulovemingming committed May 21, 2022
commit 3de2992235e43b6ce40a35624a42a08b5a5a866b
11 changes: 11 additions & 0 deletions problems/0027.移除元素.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -329,5 +329,16 @@ int removeElement(int* nums, int numsSize, int val){
}
```

Kotlin:
```kotlin
fun removeElement(nums: IntArray, `val`: Int): Int {
var slowIndex = 0 // 初始化慢指针
for (fastIndex in nums.indices) {
if (nums[fastIndex] != `val`) nums[slowIndex++] = nums[fastIndex] // 在慢指针所在位置存储未被删除的元素
}
return slowIndex
}
```

-----------------------
<div align="center"><img src=https://code-thinking.cdn.bcebos.com/pics/01二维码一.jpg width=500> </img></div>

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