aboutsummaryrefslogtreecommitdiff
path: root/challenge-180/laurent-rosenfeld/python/ch-1.py
blob: 254e6a04e56e9f245265b153ffb1edd985a60f2a (plain)
1
2
3
4
5
6
7
8
9
"""Find the first unique character in the given string"""
for test in ["Perl Weekly Challenge", "Long Live Perl"]:
    histo = dict()
    for char in test:
        histo[char] = histo.get(char, 0) + 1
    for i in range(0, len(test)):
        if histo[test[i]] == 1:
            print(test, ": ", i)
            break