Elfen-Memory

Die Aufgabe stammt aus dem Advent of Code 2020: Elfen-Memory

Puzzle-Eingabe

0,13,16,17,1,10,6

Zweiter Teil der Aufgabe

Jetzt ist nicht die 2020. Zahl im Memory-Spiel gesucht, sondern die 30.000.000..

Beispiel

Given 0,3,6, the 30000000th number spoken is 175594.
Given 1,3,2, the 30000000th number spoken is 2578.
Given 2,1,3, the 30000000th number spoken is 3544142.
Given 1,2,3, the 30000000th number spoken is 261214.
Given 2,3,1, the 30000000th number spoken is 6895259.
Given 3,2,1, the 30000000th number spoken is 18.
Given 3,1,2, the 30000000th number spoken is 362.