+ 4
Use a map where keys are characters and values are number of appearances. Initiate the map entries with 0 on all characters. Then increase the value of the entry with the current character as a key while iterating through the characters.
+ 3
There exists a count function:
https://www.cplusplus.com/reference/algorithm/count/
+ 2
Define an int or char array, size 256, that represents 256 possible values of a byte.
Loop through the characters of the string, using the byte value of each character as an index into the array. If the array value is zero then increment the corresponding element.
Else, you found a duplicate. You may break out of the loop and report it.