8000 changed for loop condition by jithset · Pull Request #6 · hitzzc/go-leetcode · GitHub
[go: up one dir, main page]

Skip to content

changed 8000 for loop condition #6

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
merged 1 commit into from
Dec 11, 2019
Merged
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
< 8000 /option>
Diff view
changed for loop condition
  • Loading branch information
jithset authored Dec 9, 2019
commit d5849f387720ddee27e7daefd049e9a2b5977b9c
2 changes: 1 addition & 1 deletion plus_one/plus_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package plus_one

func plusOne(digits []int) []int {
carry := 1
for i := len(digits); i >= 0; i++ {
for i := len(digits)-1; i >= 0; i-- {
sum := carry + digits[i]
if sum < 10 {
digits[i] = sum
Expand Down
0