当前位置:网站首页>Interview question 01.01 Determine whether the character is unique
Interview question 01.01 Determine whether the character is unique
2022-07-04 22:02:00 【Mr Gao】
Interview questions 01.01. Determine whether the character is unique
Implement an algorithm , Determine a string s Whether all the characters of are different .
Example 1:
Input : s = “leetcode”
Output : false
Example 2:
Input : s = “abc”
Output : true
This question is actually relatively simple , The solution code is as follows :
bool isUnique(char* astr){
int r[26];
int i;
for(i=0;i<26;i++){
r[i]=0;
}
i=0;
while(astr[i]!='\0'){
r[astr[i]-'a']++;
// printf("%d",)
if(r[astr[i]-'a']>=2){
return false;
}
i++;
}
return true;
}
}
边栏推荐
- Analysis of maker education technology in the Internet Era
- Daily question-leetcode556-next larger element iii-string-double pointer-next_ permutation
- Cloudcompare & open3d DBSCAN clustering (non plug-in)
- 赋能数字经济 福昕软件出席金砖国家可持续发展高层论坛
- TCP protocol three times handshake process
- Lambdaquerywrapper usage
- Golang interview finishing three resumes how to write
- Telephone encryption, middle 4 is replaced by * * * *
- [C language] deep understanding of symbols
- What is business intelligence (BI), just look at this article is enough
猜你喜欢

机器学习笔记 - 互信息Mutual Information

el-tree结合el-table,树形添加修改操作

案例分享|金融业数据运营运维一体化建设

可视化任务编排&拖拉拽 | Scaleph 基于 Apache SeaTunnel的数据集成

Case sharing | integrated construction of data operation and maintenance in the financial industry

Daily question-leetcode556-next larger element iii-string-double pointer-next_ permutation

Daily question -leetcode1200- minimum absolute difference - array - sort

Redis 排查大 key 的3种方法,优化必备

一文掌握数仓中auto analyze的使用

bizchart+slider实现分组柱状图
随机推荐
Sorting and sharing of selected papers, systems and applications related to the most comprehensive mixed expert (MOE) model in history
Delphi soap WebService server-side multiple soapdatamodules implement the same interface method, interface inheritance
Which securities company has the lowest Commission for opening an account online? I want to open an account. Is it safe to open an account online
[weekly translation go] how to code in go series articles are online!!
DevEco Device Tool 3.0 Release带来5大能力升级,让智能设备开发更高效
Kubedm initialization error: [error cri]: container runtime is not running
Acwing 2022 daily question
Analyzing the maker space contained in steam Education
ACM Multimedia 2022 | 视觉语言预训练模型中社会偏见的反事实衡量和消除
做BI开发,为什么一定要熟悉行业和企业业务?
机器学习笔记 - 互信息Mutual Information
淘宝商品评价api接口(item_review-获得淘宝商品评论API接口),天猫商品评论API接口
How to use concurrentlinkedqueue as a cache queue
What is business intelligence (BI), just look at this article is enough
NAACL-22 | 在基于Prompt的文本生成任务上引入迁移学习的设置
File read write
Why do you have to be familiar with industry and enterprise business when doing Bi development?
Three or two things about the actual combat of OMS system
gtest从一无所知到熟练使用(4)如何用gtest写单元测试
el-tree结合el-table,树形添加修改操作