Leetcode - First Unique Character in a String
https://leetcode.com/problems/first-unique-character-in-a-string/
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.
func firstUniqChar(s string) int { count := make([]int, 26) for i := 0; i < len(s); i++ { count[s[i]-'a']++ } for i := 0; i < len(s); i++ { if count[s[i]-'a'] == 1 { return i } } return -1 }
Aug 16, 2022 07:36:14 PM
Uttarakhand Board Model Paper 2023 Class 7 Pdf Download with Answers for English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type Questions to Term1 & Term2 Exams
Jan 24, 2023 06:14:43 PM
Life Insurance Corporation was established in 1956 and Is the oldest insurance company in India, and it has been providing millions of individuals with their variety of insurance schemes along with giving a good service to the business groups. LIC Online Payment Login To have a successful policy on your name, it is mandatory to make the LIC online premium payment or offline in time, and timely paying the installments of LIC will keep your policy active and that will be helpful in your emergency.