Project Euler with Ruby on WSL [Problem 16]

ふーむ

これ ruby でやると巨大数の扱いが簡単だから 結果的に簡単になる説割とあるな…。

問題

Power digit sum

215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.

What is the sum of the digits of the number 21000?

私訳

べき乗の各位の和

21000 の各位の和はいくつか

解答方針

うん。ruby だからゴリ押しでいいよね…。 ワンライナーで終わっちゃった。