646
来源:互联网 发布:网络怎么走电线 编辑:程序博客网 时间:2024/06/15 00:46
5.15
新加的这几道题,简直就是用来增加自信心的啊。
基本都是用来判断一个字符串中相同的字符的,利用HashMap解决的很是开心呢。
public class Solution { /** * @param s a string * @return it's index */ public int firstUniqChar(String s) { // Write your code here int length = s.length(); HashMap<Character,Integer> map = new HashMap<Character,Integer>(); for(int i = 0; i < length; i++){ if(!map.containsKey(s.charAt(i))){ map.put(s.charAt(i),1); } else{ map.put(s.charAt(i),map.get(s.charAt(i)) +1); } } for(int i = 0; i < length; i++){ if(map.get(s.charAt(i)) == 1){ return i; } } return -1; }}
0 0
- 646
- 微软70-646考题
- Testinside 646-671考题下载
- 70-646 在线真题
- 646-230 考试资讯分享
- uva 646 - The Gourmet Club(暴力)
- lintcode(646)First Position Unique Character
- CRM Express for Account Managers:Cisco Exam 646-096
- Testinside全新推出Cisco 646-230认证考试题库
- OCP-1Z0-053-V12.02-646题
- OCP-1Z0-053-200题-69题-646
- UVA 646 POJ 1058 The Gourmet Club(推理)
- TopCoder SRM 646 Div2 Problem 500 - TheGridDivTwo (BFS + 优先队列)
- 快拖v3.4.4.646无广告官方绿色版
- LeetCode 646 Maximum Length of Pair Chain(贪心)
- LeetCode 646 : Maximum Length of Pair Chain(c++)
- LeetCode 646 Maximum Length of Pair Chain (贪心)
- The Real MCTS/MCITP Exam 70-646 Prep Kit: Independent and Complete Self-Paced Solutions
- 阿里云部署Java web初体验
- 模拟器运行播放视频概率崩溃在[PLVideoToolbox decode:andSize:status:]崩溃
- 570D
- Java多线程系列--“JUC锁”06之 Condition条件
- mysql 查看当前使用的配置文件my.cnf的方法
- 646
- Java多线程系列--“JUC锁”07之 LockSupport
- IDEA配置Java SDK
- POJ 1167 The Buses 笔记
- Java多线程系列--“JUC锁”08之 共享锁和ReentrantReadWriteLock
- Dubbo扩展设计的学习(一):了解javaSPI
- 生成器函数
- 【数据结构】快速(QuickSort)排序之——左右指针法
- 跳过测试用例执行(Maven -DskipTests 与 -Dmaven.test.skip=true)