First Unique Character in a String — November 16, 2026
Given a string s, find the first nonrepeating character in it and return its index. If it does not exist, return 1. Constraints: s consists of only lowercase English letters. 1 <= s.length <= 10^5 Examples: Input: s = "leetcode" Output: 0 Input: s = "loveleetcode" Output: 2 Input…
