Solutions for Same Characters

    • @Glenndiuby
    • @Michael, submitted in Python 3, achived 100% score
    
    def solve(Str, patt): 
    
        minIndex = 10**9
    
        m =len(Str) 
        n =len(patt) 
    
        for i in range(n): 
            for j in range(m): 
                if (patt[i] == Str[j] and j < minIndex): 
                    minIndex = j 
                    break
        if (minIndex != 10**9): 
            return Str[minIndex]
        else: 
            return "No character present"