Last active
July 20, 2022 19:34
-
-
Save tjdevries/3a826eb8d8b452f071c9aff19adcee87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Part 1:", plzNo()) | |
fmt.Println("Part 2:", plzNo2()) | |
fmt.Println("Part 3:", plzNo3()) | |
fmt.Println("Part 4:", plzNo4()) | |
} | |
func plzNo() (i int) { | |
defer func() { i++ }() | |
return 0 | |
} | |
func plzNo2() (i int) { | |
defer func() { i++ }() | |
return i | |
} | |
func plzNo3() (i int) { | |
i = 1 | |
defer func() { i++ }() | |
return i | |
} | |
func plzNo4() int { | |
i := 0 | |
defer func() { i++ }() | |
return i | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My Guesses:
PlsNo -> 0
PlsNo2 -> 2
PlsNo3 -> 2
PlsNo4 -> 1
lol idk this hurts my brain