当前位置:网站首页>[sword finger offer] interview question 50: the first character that appears only once - hash table lookup
[sword finger offer] interview question 50: the first character that appears only once - hash table lookup
2022-07-27 15:52:00 【Jocelin47】

class Solution {
public:
char firstUniqChar(string s) {
//unordered_map<char, int> freq;
int freq[256]= {
0};
for(char ele: s)
freq[ele]++;
for(char ele: s)
if(freq[ele]== 1)
return ele;
return ' ';
}
};
边栏推荐
- Causes and solutions of deadlock in threads
- C语言:扫雷小游戏
- Inter thread wait and wake-up mechanism, singleton mode, blocking queue, timer
- 网络设备硬核技术内幕 路由器篇 22
- 【剑指offer】面试题42:连续子数组的最大和——附0x80000000与INT_MIN
- [system programming] process, thread problem summary
- 面试重点——传输层的TCP协议
- Analysis of spark task scheduling exceptions
- Go language slow start - package
- Under the ban, the Countermeasures of security giants Haikang and Dahua!
猜你喜欢
随机推荐
《吐血整理》C#一些常用的帮助类
flutter —— 布局原理与约束
C language: minesweeping games
Causes and solutions of deadlock in threads
Go language slow start -- go operator
【剑指offer】面试题56-Ⅰ:数组中数字出现的次数Ⅰ
Is low code the future of development? On low code platform
/Dev/loop1 takes up 100% of the problem
折半插入排序
【剑指offer】面试题41:数据流中的中位数——大、小堆实现
【剑指offer】面试题45:把数组排成最小的数
C语言:三子棋游戏
[sword finger offer] interview question 39: numbers that appear more than half of the time in the array
Zhaoqi scientific innovation and entrepreneurship competition planning and undertaking organization, mass entrepreneurship and innovation platform, project landing and docking
JS find the maximum and minimum values in the array (math.max() method)
Binder初始化过程
【剑指offer】面试题49:丑数
$router.back(-1)
JS operation DOM node
为应对RISC-V挑战?Arm CPU引入自定义指令功能!





![[sword finger offer] interview question 41: median in data flow - large and small heap implementation](/img/c3/7caf008b3bd4d32a00b74f2c508c65.png)


