This 214966378 is the code i'm getting wrong answer for.
I've added comments too..for ease. But a quick overview — For numbers <= n , i'm making a different list (since trap cannot be set after n) , then sorting it, and iterating by calculating the divisors present till index i and setting final_answer as the maximum of those. Would be happy if somebody could help. Thanks!