当前位置:网站首页>OR63 删除公共字符
OR63 删除公共字符
2022-07-29 21:49:00 【syc596】
OR63 删除公共字符
删除公共字符_牛客题霸_牛客网 (nowcoder.com)
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
String str1=sc.nextLine();
String str2=sc.nextLine();
String ret="";
Map<Character,Integer> map=new HashMap<>();
for(int i=0;i<str2.length();i++){
if(map.containsKey(str2.charAt(i))==false){
map.put(str2.charAt(i),1);
}else{
map.put(str2.charAt(i),map.get(str2.charAt(i))+1);
}
}
for(int i=0;i<str1.length();i++){
if(map.containsKey(str1.charAt(i))==false){
ret+=str1.charAt(i);
}
}
System.out.println(ret);
}
}
}边栏推荐
猜你喜欢
随机推荐
Sorry, it's hard for you to earn middle-aged money
刀具更换策略问题(完工)
leetcode122. Best Time to Buy and Sell Stock II
一文理解分布式开发中的服务治理
【HDLBits 刷题】Verilog Language(4)Procedures 和 More Verilog Features 部分
新库上线 | CnOpenData国际货运代理信息数据
Xshell 7 prompts "To continue using this program, you must apply the latest update or use a new version"
方法的传递
Advanced Mathematics (Seventh Edition) Tongji University Exercises 3-8 Individual Answers
百度智能云章淼:详解企业级七层负载均衡开源软件BFE
SAP BC 源代码搜索
防火墙——SNAT和DNAT策略的原理及应用、防火墙规则的备份和还原
COPU陆首群教授应邀在ApacheCon Asia会议上致辞
给图片左上角加logo标识、左下角加时间和地址、地址到达指定长度换行
applet preview pdf
GBASE 8s 如何并行执行update statistics
Xshell 7 提示 “要继续使用此程序,您必须应用最新的更新或使用新版本”
在Ferora35中安装oracle-database-xe-21c
六、HikariConfig配置解析
研究生怎么申请专利,流程是什么?









