CommonTwo
2024-10-07 15:17:53
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
最新文章
- solr服务中集成IKAnalyzer中文分词器、集成dataimportHandler插件
- Android中点击隐藏软键盘最佳方法——Android开发之路4
- Win10中安装ArcObject帮助
- android音视频点/直播模块开发
- 从头来之【图解针对虚拟机iOS开发环境搭建】
- 定制类自己的的new_handler
- 《30天自制操作系统》11_day_学习笔记
- 仿写Windows7桌面和任务栏 HTML5+CSS3+Jquery实现
- 微信小程序- 生成二维码
- java~springboot~ibatis Invalid bound statement (not found)原因
- vs2017开发IOS(vs2017 xamarin 连接mac)
- vba多条件查询更新EXCEL数据导access数据库
- redis操作(String,Hash,List,Set,其他操作)
- live555源码学习1---Socket流程架构图
- A1110. Complete Binary Tree
- 利用iOS中Safari浏览器创建伪Web App
- Installing OpenSSH from the Settings UI on Windows Server 2019 or Windows 10 1809
- MySQL 联合索引测试3
- Oracle Data Provider for .NET的使用(三)-ORACLE与.NET类型对应关系
- Deep Learning深入浅出
热门文章
- May 1 2017 Week 18 Monday
- *387. First Unique Character in a String (linkedhashmap + string) debug manunally instead of using leetcode
- 【转载】#370 - Subscribe to an Event by Adding an Event Handle
- vector的几种初始化和遍历
- Mac 中显示资源库(Library)文件夹目录的几种方法
- An error occurred at line: 1 in the generated java file问题处理
- DTcms网站伪静态逻辑
- (转)ActionContext和ServletActionContext
- spring-JDBC Template
- 利用sysbench进行MySQL OLTP基准测试