First Unique Character in a String — December 2, 2026
Given a string s, find the first nonrepeating character in it and return its index. If it does not exist, return 1. The string s consists of only lowercase English letters. Example 1: Input: s = "leetcode" Output: 0 Example 2: Input: s = "loveleetcode" Output: 2 Example 3: Input: s = "aabb" Output: