:ok_hand: Problem 30

ruby p30.rb  7.23s user 0.01s system 99% cpu 7.245 total