tree in array, dfs, number theory, brute force

Level E