public int commonTwo(String[] a, String[] b) {
int startA=0;
int startB=0;
int count=0; while((( startA < a.length ) && ( startB < b.length )))
{
if(startA >0){
if(a[startA].equals(a[startA-1])){
startA++;
continue;
}
}
if(startB >0){
if(b[startB].equals(b[startB-1])){
startB++;
continue;
}
} if( a[startA].equals(b[startB]) ){
count++;
startA++;
startB++;
}
else if( (a[startA].compareTo(b[startB])) < 0 ){
startA++;
}
else{
startB++;
} }
return count; }

http://codingbat.com/prob/p100369

最新文章

  1. solr服务中集成IKAnalyzer中文分词器、集成dataimportHandler插件
  2. Android中点击隐藏软键盘最佳方法——Android开发之路4
  3. Win10中安装ArcObject帮助
  4. android音视频点/直播模块开发
  5. 从头来之【图解针对虚拟机iOS开发环境搭建】
  6. 定制类自己的的new_handler
  7. 《30天自制操作系统》11_day_学习笔记
  8. 仿写Windows7桌面和任务栏 HTML5+CSS3+Jquery实现
  9. 微信小程序- 生成二维码
  10. java~springboot~ibatis Invalid bound statement (not found)原因
  11. vs2017开发IOS(vs2017 xamarin 连接mac)
  12. vba多条件查询更新EXCEL数据导access数据库
  13. redis操作(String,Hash,List,Set,其他操作)
  14. live555源码学习1---Socket流程架构图
  15. A1110. Complete Binary Tree
  16. 利用iOS中Safari浏览器创建伪Web App
  17. Installing OpenSSH from the Settings UI on Windows Server 2019 or Windows 10 1809
  18. MySQL 联合索引测试3
  19. Oracle Data Provider for .NET的使用(三)-ORACLE与.NET类型对应关系
  20. Deep Learning深入浅出

热门文章

  1. May 1 2017 Week 18 Monday
  2. *387. First Unique Character in a String (linkedhashmap + string) debug manunally instead of using leetcode
  3. 【转载】#370 - Subscribe to an Event by Adding an Event Handle
  4. vector的几种初始化和遍历
  5. Mac 中显示资源库(Library)文件夹目录的几种方法
  6. An error occurred at line: 1 in the generated java file问题处理
  7. DTcms网站伪静态逻辑
  8. (转)ActionContext和ServletActionContext
  9. spring-JDBC Template
  10. 利用sysbench进行MySQL OLTP基准测试