当前位置:网站首页>Sword finger offer 50 First character that appears only once
Sword finger offer 50 First character that appears only once
2022-06-25 16:58:00 【GRT has to keep working hard】

class Solution {
public char firstUniqChar(String s) {
HashMap<Character,Boolean> dict = new HashMap<>();
char[] ch = s.toCharArray();
for(char c:ch){
dict.put(c,!dict.containsKey(c));
}
for(char c:ch){
if(dict.get(c)){
return c;}
}
return ' ';
}
}
边栏推荐
- 使用PyWebIO测试,刚入门的测试员也能做出自己的测试工具
- Effects and laws
- [proficient in high concurrency] deeply understand the basics of assembly language
- File operation, serialization, recursive copy
- Tensorflow old version
- AD域登录验证
- A complete collection of APP testing tools. It's enough to collect this one
- Protocol and hierarchy
- 使用hbuilder X创建uniapp项目
- JVM内存结构
猜你喜欢

JVM內存結構

使用hbuilder X创建uniapp项目

3. conditional probability and independence

心樓:華為運動健康的七年築造之旅

Wireshark网卡无法找到或没有显示的问题

Kalman Filter 遇到 Deep Learning : 卡尔曼滤波和深度学习有关的论文

The problem of missing precision of kettle table input components

mysql使用过程中遇到的问题

Paper notes: lbcf: a large scale budget constrained causal forest algorithm

协议和分层次
随机推荐
代码注释的艺术,优秀代码真的不需要注释吗?
Unity技术手册 - 干扰/噪音/杂波(Noise)子模块
Day21 multithreading
使用PyWebIO测试,刚入门的测试员也能做出自己的测试工具
Structure de la mémoire JVM
2022-06-17 网工进阶(九)IS-IS-原理、NSAP、NET、区域划分、网络类型、开销值
Optimization of lazyagg query rewriting in parsing data warehouse
卡尔曼时间序列预测
Wireshark网卡无法找到或没有显示的问题
居家办公让我绩效拿了C | 社区征文
Ncnn source code learning collection
剑指 Offer 39. 数组中出现次数超过一半的数字
Perfect shuffle problem
【精通高并发】深入理解汇编语言基础
Effects and laws
_ 17 collection overview
解析数仓lazyagg查询重写优化
Unity技术手册 - 生命周期内大小(Size over Lifetime)和速度决定大小(Size by Speed)
Optimization of lazyagg query rewriting in parsing data warehouse
et al和etc区别