Repetitive Palindrome
Time limit1sMemory limit1024 MB
Given a lowercase string s and integer k, decide if t formed by concatenating k copies of s is a palindrome.
- Level
Medium4 of 10
- Topics
- String, Math, Implementation
- Solved
- No attempts yet
Problem
You are given a string of lowercase alphabets and an integer .
Form a new string by concatenating copies of . Determine whether is a palindrome, that is, whether it reads the same forward and backward.
Input
The first line contains a string of lowercase alphabets. ()
The second line contains an integer . ()
Output
If is a palindrome, print YES. Otherwise, print NO.