Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class FirstProblemSolution {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int n;
- n = input.nextInt();
- input.nextLine();
- String text;
- text = input.nextLine();
- String sampleOne = text.substring(0, n);
- String sampleTwo = text.substring(text.length() - n, text.length());
- if(sampleOne.equals(sampleTwo)) {
- System.out.println("Yes");
- } else {
- System.out.println("No");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement