Solution for Day 25
This commit is contained in:
parent
8045c9b9d8
commit
f73a675027
14
day_25/first.rb
Normal file
14
day_25/first.rb
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
d_pub = 17_607_508
|
||||||
|
c_pub = 15_065_270
|
||||||
|
modulo = 20_201_227
|
||||||
|
|
||||||
|
subject_mum = 7
|
||||||
|
val = 1
|
||||||
|
|
||||||
|
0.step do |i|
|
||||||
|
(puts(c_pub.pow(i, modulo)); break) if val == d_pub
|
||||||
|
val *= subject_mum
|
||||||
|
val %= modulo
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user