Skip to content

Commit

Permalink
Problem 206
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbantuelle committed Aug 6, 2018
1 parent 474c005 commit a7c11fa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 206.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ceiling = 1_389_026_620
floor = 1_010_101_010

(ceiling..floor).step(10) do |i|
if i % 10 == 0
num = (i**2).to_s
if num[16] == '9' && num[14] == '8' && num[12] == '7' && num[10] == '6' && num[8] == '5' && num[6] == '4' && num[4] == '3' && num[2] == '2'
puts "Original Number: #{i} - Square: #{num}"
break
end
end
end

0 comments on commit a7c11fa

Please sign in to comment.