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!
After the sieve, sieve[i] for all prime numbers i will be 0. So, to fix it, for all prime_numbers, sieve[i] = i.