Complete "longest common ..." examples (#100)
* no else return * fix var ref * fix importing/requiring dependencies * complete longest common examples
This commit is contained in:
committed by
Aditya Bhargava
parent
c23ca90b83
commit
5b675cc2e8
@@ -6,9 +6,9 @@ func countdown(i int) {
|
||||
fmt.Println(i)
|
||||
if i <= 0 {
|
||||
return
|
||||
} else {
|
||||
countdown(i - 1)
|
||||
}
|
||||
|
||||
countdown(i - 1)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -5,9 +5,9 @@ import "fmt"
|
||||
func fact(x int) int {
|
||||
if x == 1 {
|
||||
return 1
|
||||
} else {
|
||||
return x * fact(x-1)
|
||||
}
|
||||
|
||||
return x * fact(x-1)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user