#K11431. Code Keyword Checker
Code Keyword Checker
Code Keyword Checker
You are given a list of reserved keywords and a set of lines of source code. Your task is to determine whether any of the reserved keywords appear as a substring in any of the code lines. If at least one reserved keyword is found, print Disqualified
; otherwise, print Qualified
.
Details:
- Let \(N\) be the number of reserved keywords.
- Followed by \(N\) lines each containing a reserved keyword.
- Then an integer \(M\) denotes the number of lines of code.
- Followed by \(M\) lines representing the source code.
Example:
Input: 2 private public 4 class Example { void method() { } }</p>Output: Qualified
Note: A keyword is considered present if it appears as a substring in any code line.
inputFormat
The input is read from stdin and is structured as follows:
- An integer \(N\) indicating the number of reserved keywords.
- \(N\) lines each containing a reserved keyword.
- An integer \(M\) indicating the number of lines of source code.
- \(M\) lines of code.
outputFormat
Print a single line to stdout containing either Qualified
or Disqualified
based on whether any reserved keyword is found in the code.
2
private
public
4
class Example {
void method() {
}
}
Qualified
</p>