As reported: Walmart SDE-3 (React / TypeScript) interviews (2025): First Unique Character in a String, alongside Sliding Window Median.
Given a string s, return the index of the first character that occurs exactly once, or -1 if none does.
This is LeetCode 387 — First Unique Character in a String.
Example
"leetcode" -> 0
"loveleetcode" -> 2
"aabb" -> -1
Constraints: 1 ≤ s.length ≤ 10^5; lowercase English letters.
Code runner format: one line with s as a JSON string. Implement firstUniqChar(s); the harness prints the index.