-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXauDayDu.java
More file actions
30 lines (30 loc) · 830 Bytes
/
XauDayDu.java
File metadata and controls
30 lines (30 loc) · 830 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
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package JAVA;
import java.util.*;
import java.math.*;
/**
*
* @author khanh
*/
public class XauDayDu {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
sc.nextLine();
String s=sc.nextLine();
HashSet<Character> a=new HashSet<>();
int n=s.length();
for(int i=0;i<n;i++){
a.add(s.charAt(i));
}
int nn=a.size();
int cc=26-nn;
int k=sc.nextInt();
System.out.println(cc<=k ? "YES" : "NO");
}
}
}