Shows that this is the fastest ruby solution so far so I thought that I would share


  • 0
    J
    def first_uniq_char(s)
        s.chars.uniq.each do |x|
            return s.index(x) if s.count(x) == 1
        end
        -1
        
    end
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.