I was trying a problem in which I wanted to delete some elements from the set while iterating over the elements of the set.
Link to the problem: Problem C, Educational Round #108
Pseudo Code
for(condition in list_of_conditions):
for(element X in set):
if(condition(X) is false):
remove X from the set
else:
answer += result(X)
However, I failed to implement this in an optimized way. I wonder what are some of the shortest and most optimized codes to implement this idea...
Please share your ideas. Thank you!