LeetCode May Challenge – First Unique Character in a String – [Amazon Mülakat Sorusu] 5. GÜN

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.