首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
第一个不重复的字符
[编程题]第一个不重复的字符
热度指数:108
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 256M,其他语言512M
算法知识视频讲解
在字符串中找到第一个不重复的字符。
例:对于字符串“hellohehe”,第一个不重复的字符是“o”。
如果每个字符都有重复,则抛出运行时异常。
示例1
输入
"hellohehe"
输出
o
备注:
允许使用集合类
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(0)
邀请回答
收藏(4)
分享
纠错
提交结果有问题?
5个回答
0篇题解
开通博客
暂无题解
问题信息
阅文集团
2021
Java工程师
来自:
2023届阅文Java...
上传者:
小小
难度:
5条回答
4收藏
2978浏览
热门推荐
通过挑战的用户
H&C_
2023-03-09 22:53:19
牛客67246...
2022-11-04 16:10:03
神猫TOM
2022-11-01 14:45:05
Dubbozz
2022-11-01 12:57:32
牛客16255...
2022-06-20 19:09:49
相关试题
五月份的商品销售额为60万元,该月...
数据分析师
途虎
2021
评论
(2)
来自
途虎养车2023秋招数据...
下列哪两个变量之间的相关程度高
数据分析师
途虎
2021
评论
(4)
来自
途虎养车2023秋招数据...
计算朋友圈
Java工程师
阅文集团
2021
评论
(9)
来自
2023届阅文Java方...
开启两个线程A、B,打印1到10,...
Java工程师
阅文集团
2021
评论
(12)
来自
2023届阅文Java方...
矩阵乘法
Java工程师
阅文集团
2021
评论
(5)
来自
2023届阅文Java方...
第一个不重复的字符
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
import java.util.*; public class Solution { /** * * @param str string字符串 * @return char字符型 */ public char findFirstNonRepeatChar (String str) { // write code here } }
class Solution { public: /** * * @param str string字符串 * @return char字符型 */ char findFirstNonRepeatChar(string str) { // write code here } };
# # # @param str string字符串 # @return char字符型 # class Solution: def findFirstNonRepeatChar(self , str ): # write code here
/** * * @param str string字符串 * @return char字符型 */ function findFirstNonRepeatChar( str ) { // write code here } module.exports = { findFirstNonRepeatChar : findFirstNonRepeatChar };
# # # @param str string字符串 # @return char字符型 # class Solution: def findFirstNonRepeatChar(self , str ): # write code here
package main /** * * @param str string字符串 * @return char字符型 */ func findFirstNonRepeatChar( str string ) byte { // write code here }
/** * * @param str string字符串 * @return char字符型 */ char findFirstNonRepeatChar(char* str ) { // write code here }
"hellohehe"
o