import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine()){
String s = sc.nextLine();
String[] str = s.split(" ");
String[] A = str[0].split("");
String[] B = str[1].split("");
Map<String, Integer> mapA = new HashMap<>();
Map<String, Integer> mapB = new HashMap<>();
for(String s1 : A){
if(mapA.containsKey(s1)){
mapA.put(s1, mapA.get(s1) + 1);
}else{
mapA.put(s1, 1);
}
}
for(String s1 : B){
if(mapB.containsKey(s1)){
mapB.put(s1, mapB.get(s1) + 1);
}else{
mapB.put(s1, 1);
}
}
int count = 0;
for(int i = 0; i < B.length; i++){
if(mapA.containsKey(B[i])){
mapA.put(B[i], mapA.get(B[i]) - 1);
if(mapA.get(B[i]) < 0){
System.out.println("No");
break;
}
count++;
}else{
System.out.println("No");
break;
}
}
if(count == B.length){
System.out.println("Yes");
}
}
}
}
Java乒乓球筐
最新推荐文章于 2024-11-03 11:01:20 发布