[Community Puzzle] Goldbach’s Conjecture

I had the same problem! It was so frustrating to find out the culprit. Ultimately with the help of this thread and some ChatGPT magic, I realized I was looping through items in a “list” rather than a “set” (while working with Python)
Then I modified my code to store the sieve as a set and then the final test case worked!

Before making this change, I was so annoyingly close to the solution as only the last 10-20 inputs of the final test case weren’t running (timed out). I tried to make many changes in my code but ultimately only a change in the data structure helped. :sweat_smile:

And for those who are interested in the answer:

[nope]

Guys, I think I have managed to code a solution, but it is not optimized, it working only with small numbers. Can someone give me a hint:

[mod edit: please avoid posting code here]

Please read the earlier discussion for hints on optimization.

hi I see that my previous comment was modified by somebody!

does codingame not accept solutions to be discussed in forums?

and by solutions i mean actual code snippets and not just theory