LeetCode’un mayıs ayı için her gün bir programlama sorusu sorduğu “May Challenge”‘ın beşinci gün sorusu “First Unique Character in a String””in açıklaması ve çözümü. LeetCode’a göre Amazon mülakatlarında sorulmuş sorulardan biri.
🔥 LeetCode May Challenge: https://leetcode.com/explore/featured/card/may-leetcoding-challenge
➡️ Problem açıklaması:
Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.
Examples:
s = “leetcode” return 0.
s = “loveleetcode”, return 2.
Note: You may assume the string contain only lowercase letters.