Skip to content

Commit

Permalink
Solves a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Caul58 committed Mar 29, 2024
1 parent 1fb1f30 commit fb0070a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func isArmstrong(_ num: Int) -> Bool {

let numberString = String(num)
let power = Double(numberString.count)
var sum = numberString.reduce(0) { res, char in
let sum = numberString.reduce(0) { res, char in
res + Int(pow(Double(char.description) ?? 0, power))
}
return sum == num
Expand Down
2 changes: 1 addition & 1 deletion Challenges2022.playground/contents.xcplayground
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<page name='Challenge#11'/>
<page name='Challenge#12'/>
<page name='Challenge#13'/>
<page name='Challenge#14'/>
<page name='Challenge#43'/>
<page name='Challenge#44'/>
<page name='Challenge#45'/>
<page name='Challenge#14'/>
</pages>
</playground>

0 comments on commit fb0070a

Please sign in to comment.