Skip to content
This repository has been archived by the owner on Jun 20, 2020. It is now read-only.

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza committed Jul 26, 2011
1 parent b56dfab commit 2181ad0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions problem_040/40.go
Expand Up @@ -6,6 +6,10 @@ import (
)

func BuildSequence(position int) string {
if position < 10 {
return strconv.Itoa(position)
}

var fractional string
digits := make([]string, 0)

Expand All @@ -19,8 +23,5 @@ func BuildSequence(position int) string {

func FindNthDigit(position int) uint8 {
fractional := BuildSequence(position)
return fractional[position] - '0'
}

func main() {
return fractional[position - 1] - '0'
}

0 comments on commit 2181ad0

Please sign in to comment.