Solutions for Repeated Character

    • @Glenndiuby
    • @Michael, submitted in Python 3, achived 100% score
    def FirstRepeated(string): 
    
        checker = 0
    
        pos = 0
        for i in string: 
            val = ord(i) - ord('a'); 
            if ((checker & (1 << val)) > 0): 
                return pos 
            checker |= (1 << val) 
            pos += 1
    
        return -1
    def solve(string):
        i = FirstRepeated(string)
        if i != -1: 
            return string[i]
        else: 
            return "No repeated Char"