当前位置:网站首页>【剑指offer】面试题50:第一个只出现一次的字符——哈希表查找
【剑指offer】面试题50:第一个只出现一次的字符——哈希表查找
2022-07-27 14:24: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 ' ';
}
};
边栏推荐
- With just two modifications, apple gave styleganv2 3D generation capabilities
- IJCAI 2022 outstanding papers were published, and 298 Chinese mainland authors won the first place in two items
- 西瓜书《机器学习》阅读笔记之第一章绪论
- Unity性能优化------渲染优化(GPU)之Occlusion culling(遮挡剔除)
- 后台返回来的是这种数据,是什么格式啊
- Network equipment hard core technology insider router Chapter 21 reconfigurable router
- TCC
- Digital storage oscilloscope based on FIFO idt7202-12
- Spark 3.0 测试与使用
- MySQL interview 40 consecutive questions, interviewer, if you continue to ask, I will turn my face
猜你喜欢

With just two modifications, apple gave styleganv2 3D generation capabilities

Spark TroubleShooting整理

AssetBundle如何打包

Spark 3.0 Adaptive Execution 代码实现及数据倾斜优化

4种单片机驱动继电器方案

Adaptation verification new occupation is coming! Huayun data participated in the preparation of the national vocational skill standard for information system adaptation verifiers

Unity performance optimization ----- occlusion culling of rendering optimization (GPU)
Principle of MOS tube to prevent reverse connection of power supply

Spark Bucket Table Join

Several basic uses of tl431-2.5v voltage reference chip
随机推荐
Simple mathematical knowledge related to 3D
Network equipment hard core technology insider router Chapter 17 dpdk and its prequel (II)
CAN总线的EMC设计方案
js寻找数组中的最大和最小值(Math.max()方法)
Network equipment hard core technology insider router Chapter 21 reconfigurable router
使用Prometheus监控Spark任务
STM32学习之CAN控制器简介
Network equipment hard core technology insider router 20 dpdk (V)
[0 basic operations research] [super detail] column generation
光电隔离电路设计方案(六款基于光耦、AD210AN的光电隔离电路图)
With just two modifications, apple gave styleganv2 3D generation capabilities
generic paradigm
Introduction of the connecting circuit between ad7606 and stm32
Inside router of network equipment hard core technology (10) disassembly of Cisco asr9900 (4)
Huayun data creates a perfect information technology and innovation talent training system to help the high-quality development of information technology and innovation industry
Unity性能优化------渲染优化(GPU)之LOD(Level of detail)
Leetcode interview question 17.21. water volume double pointer of histogram, monotonic stack /hard
Design scheme of digital oscilloscope based on stm32
Leetcode 244周赛-赛后补题题解【西兰花选手】
设置提示框位置随鼠标移动,并解决提示框显示不全的问题