-
Notifications
You must be signed in to change notification settings - Fork 0
/
R101A.java
66 lines (42 loc) · 1.12 KB
/
R101A.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
*In the name of Allah the Most Merciful.
* Author
* Md. Toufiqul Islam
* Dept. Of CSE
* Ahsanullah University Of Science And Technology
*/
package CodeForces;
import java.util.Arrays;
import java.util.Scanner;
public class R101A {
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
String first = sc.nextLine();
String second = sc.nextLine();
String third = sc.nextLine();
if(first.length()+second.length()==third.length()){
char[] thirdAr = third.toCharArray();
String firstplusSecond = first.concat(second);
char[] firstplusSecondArr = firstplusSecond.toCharArray();
// System.out.println(firstplusSecond);
//Arrays.sort(firstAr);
// Arrays.sort(secondAr);
Arrays.sort(firstplusSecondArr);
Arrays.sort(thirdAr);
boolean isFound = true;
for(int i=0;i<thirdAr.length;i++){
if(thirdAr[i]!=firstplusSecondArr[i]){
System.out.println("NO");
isFound = false;
break;
}
}
if(isFound){
System.out.println("YES");
}
}
else{
System.out.println("NO");
}
}
}