carloscn / carloscn/structstudy

leetcode387:字符串中的第一个唯一字符(first-unique-character-in-a-string)

Open
#88 2 comments 0 reactions 1 assignee Claimed by @carloscn View on GitHub
Level-easy 一般问题 字符串 查找
Dominant language
C
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

给定一个字符串 s ,找到 它的第一个不重复的字符,并返回它的索引 。如果不存在,则返回 -1 。

示例 1:
输入: s = "leetcode"
输出: 0

示例 2:
输入: s = "loveleetcode"
输出: 2

示例 3:
输入: s = "aabb"
输出: -1
 
提示:
1 <= s.length <= 105
s 只包含小写字母

来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/first-unique-character-in-a-string

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.