gray code

536ms
676ms
gray code solution 2

532ms
648ms