pyassistant

First non-repeating character index

Given a string s, return the index of the first non-repeating character in it. If every character repeats, return -1. Characters are case-sensitive.

Example:

Input:
'leetcode'
Output:
0

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.