Skynet strike back

Can anybody tell what is the algorithm for Skynet strike back?

https://www.codingame.com/forum/t/skynet-finale-2-puzzle-discussion/61 ?