mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-26 21:46:30 +08:00
Merge pull request #60 from halfrost/code_quality_improvement
optimization code quality level from A to A+
This commit is contained in:
@ -4,9 +4,9 @@ func removeDuplicates80(nums []int) int {
|
||||
if len(nums) == 0 {
|
||||
return 0
|
||||
}
|
||||
last, finder, startFinder := 0, 0, -1
|
||||
last, finder := 0, 0
|
||||
for last < len(nums)-1 {
|
||||
startFinder = -1
|
||||
startFinder := -1
|
||||
for nums[finder] == nums[last] {
|
||||
if startFinder == -1 || startFinder > finder {
|
||||
startFinder = finder
|
||||
|
Reference in New Issue
Block a user