-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain1.java
More file actions
37 lines (32 loc) · 888 Bytes
/
Main1.java
File metadata and controls
37 lines (32 loc) · 888 Bytes
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
import java.util.*;
public class Main1
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
String s1 = scan.nextLine();
char[] array1 = s1.toCharArray();
String s2 = scan.nextLine();
char[] array2 = s2.toCharArray();
int[] countArray = new int[26];
int[] countArray2 = new int[26];
boolean b = true;
for(char c: array1)
{
countArray[c-97]++;
}
for(char c: array2)
{
if(c >= 97 && c <= (122))
{
countArray2[c-97]++;
}
}
for(int i = 0; i<countArray.length;i++)
{
if(countArray2[i] > countArray[i]) b = false;
}
if(b) System.out.println("A");
else System.out.println("N");
}
}