当前位置:网站首页>First character that appears only once
First character that appears only once
2022-06-26 08:26:00 【xuanningmeng】
The first character that appears only once
In string s Find the first character that appears only once . without , Return a single space . s Contains only lowercase letters .
Example :
s = “abaccdeff”
return “b”
s = “”
return " "
Ideas 1 explain : String rotation list, Count the number of occurrences of each character , If the number of occurrences of a character is 1, Output , Otherwise, the output is empty . This idea increases with the length of the string , It takes a lot of time .
Ideas 2 explain : Build a dictionary , The character appears once as True, Appear many times , by False, One of the output dictionaries True Corresponding characters 
边栏推荐
- Design based on STM32 works: multi-functional atmosphere lamp, wireless control ws2812 of mobile app, MCU wireless upgrade program
- Idea uses regular expressions for global substitution
- XXL job configuration alarm email notification
- MySQL insert Chinese error
- How to Use Instruments in Xcode
- optee中的timer代码导读
- Assembly led on
- Calculation of decoupling capacitance
- CodeBlocks集成Objective-C开发
- Getting started with idea
猜你喜欢

Vs2019-mfc setting edit control and static text font size

STM32 project design: smart home system design based on stm32

leetcode2022年度刷题分类型总结(十二)并查集

HEVC学习之码流分析

How to debug plug-ins using vs Code

Rewrite string() method in go language

Can the encrypted JS code and variable name be cracked and restored?

Wechat applet beginner level chapter
![[postgraduate entrance examination] group planning exercises: memory](/img/ac/5c63568399f68910a888ac91e0400c.png)
[postgraduate entrance examination] group planning exercises: memory

Chapter VII (structure)
随机推荐
Example of offset voltage of operational amplifier
Discrete device ~ diode triode
Win11 open folder Caton solution summary
STM32 based d18s20 (one wire)
Uniapp uses uviewui
Apple motherboard decoding chip, lightning Apple motherboard decoding I.C
How to Use Instruments in Xcode
I Summary Preface
MySQL practice: 1 Common database commands
[untitled]
Diode voltage doubling circuit
Blue Bridge Cup 3 sequence summation
Solve the problem that pychar's terminal cannot enter the venv environment
Application of wireless charging receiving chip xs016 coffee mixing cup
2020-10-20
Vs2019-mfc setting edit control and static text font size
Chapter VIII (classes and objects)
Recognize the interruption of 80s51
Uniapp wechat withdrawal (packaged as app)
Design of reverse five times voltage amplifier circuit