Načítava sa úloha…
Sometimes you need to find the first character that appears only once in a string, such as the first unique letter in a code, name, or message. Given a string s, return the index of the first non-repeating character. If every character repeats, return -1.
"leetcode"0"loveleetcode"2"aabb"-1def first_uniq_char(s: str) -> int:
Prihláste sa, aby ste videli históriu odoslaní
Prihlásiť saPrihláste sa, aby ste mohli používať AI mentora
Prihlásiť sa"leetcode"0"loveleetcode"2"aabb"-1"z"0"aadadaad"-1" "-1