. . "Since you are iterating through all items and checking whether they are selected or not all you need to do is set a flag that will become true the moment one of the items is not selected (meaning, there will be at least one item left to be added)." . .