原文:[LeetCode] 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 . Examples: Note: You may assume the string contain only lowercase letters. 這道題確實沒有什么難度 ...

2016-08-24 11:13 4 10391 推薦指數:

查看詳情

Leetcode練習(Python):第387題:字符串中的第一個唯一字符:給定一個字符串,找到它的第一個不重復的字符,並返回它的索引。如果不存在,則返回 -1。

題目: 字符串中的第一個唯一字符:給定一個字符串,找到它的第一個不重復的字符,並返回它的索引。如果不存在,則返回 -1。 案例: 注意事項:您可以假定該字符串只包含小寫字母。 思路: 哈希表,較簡單。 程序: class Solution: def ...

Mon Jun 01 18:50:00 CST 2020 0 806
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM