avoiding multiple allocation, but still exceeds time limit
marking the attacked locations after adding each candidate. Still has errors