Question: You are given a string ‘s’. Print all the duplicate characters of string.
my code is:
string = input()
elements = {}
for char in string:
if char in elements:
elements[char] += 1
else:
elements[char] = 1
print(-1)
for key, value in elements.items():
if value > 1:
print(key)
print()
i dono how to rectify it.could some help me out
Testcase Status:
>>> error
Input:
abcdd
Expected Output:
d
Actual Output:
-1
d

