当前位置:网站首页>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 
边栏推荐
- Esp8266wifi module tutorial: punctual atom atk-esp8266 for network communication, single chip microcomputer and computer, single chip microcomputer and mobile phone to send data
- The difference between setstoragesync and setstorage
- Macro task, micro task, async, await principle of interview
- JWT in go
- Method of measuring ripple of switching power supply
- Interpretation of x-vlm multimodal model
- Monitor iPad Keyboard Display and hide events
- Late 2021 plan
- See which processes occupy specific ports and shut down
- Undefined symbols for architecture i386 is related to third-party compiled static libraries
猜你喜欢

1. error using XPath to locate tag

Win11 open folder Caton solution summary

MySQL practice: 4 Operation of data

MySQL practice: 2 Table definition and SQL classification

Interpretation of x-vlm multimodal model

STM32 project design: smart home system design based on stm32

Uniapp wechat withdrawal (packaged as app)

MySQL practice: 3 Table operation

Flume learning notes

Calculation of decoupling capacitance
随机推荐
Wechat applet beginner level chapter
Database learning notes II
Color code
Learn signal integrity from zero (SIPI) - (1)
STM32 encountered problems using encoder module (library function version)
Listview control
Oracle database self study notes
51 MCU project design: Based on 51 MCU clock perpetual calendar
I Summary Preface
JS Date object
Uniapp uses uviewui
Detailed explanation of SOC multi-core startup process
Analysis of internal circuit of operational amplifier
Chapter 9 (using classes and objects)
Necessary protection ring for weak current detection
Teach you a few tricks: 30 "overbearing" warm words to coax girls, don't look regret!
STM32 porting mpu6050/9250 DMP official library (motion_driver_6.12) modifying and porting DMP simple tutorial
STM32 project design: smart home system design based on stm32
[postgraduate entrance examination] group planning exercises: memory
RecyclerView Item 根据 x,y 坐标得到当前position(位置)