Hi,

If a duplicate is detected within the do while loop, an increment is made, and the new name is saved. The duplicateName variable controls only the id assigned to duplicate names. Hence, the 3rd duplicate name in the list may have duplicate name count of 4, based on whether other related names already exist.