remove aoc solutions
This commit is contained in:
22
examples/euler/euler_14.zr
Normal file
22
examples/euler/euler_14.zr
Normal file
@@ -0,0 +1,22 @@
|
||||
func collatz_num[n: i64] : i64
|
||||
if n % 2 == 0
|
||||
return n / 2
|
||||
return n * 3 + 1
|
||||
|
||||
func collatz_seq[n: i64]: i64
|
||||
i := 1
|
||||
while n != 1
|
||||
n = collatz_num(n)
|
||||
i += 1
|
||||
return i
|
||||
|
||||
func main[] : i64
|
||||
max := 0
|
||||
max_index := 0
|
||||
|
||||
for i in 1..1000000
|
||||
seq := collatz_seq(i)
|
||||
if seq > max
|
||||
max = seq
|
||||
max_index = i
|
||||
io.println_i64(max_index)
|
||||
Reference in New Issue
Block a user