Added defense against two more solutions in AI algorithm