Write and Erase AtCoder - 3530 JAVA

该博客讨论了如何确定经过一定次数的字符串旋转操作后,两个英文小写字母组成的字符串S是否等于T。字符串旋转操作是将S的最后一个字符移至首位。题目给出约束条件并提供了样例输入和输出,帮助理解问题。
摘要由CSDN通过智能技术生成

String Rotation

 AtCoder - 4171 

Problem Statement

 

You are given string S and T consisting of lowercase English letters.

Determine if S equals T after rotation.

That is, determine if S equals T after the following operation is performed some number of times:

Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.

Here, |X| denotes the length of the string X.

Constraints

 

  • 2 \leq |S| \leq 100
  • |S| = |T|
  • S and T consist of lowercase English letters.

Input

 

Input is given from Standard Input in the following format:

S
T

Output

 

If S equals T after rotation, print Yes; if it does not, print No.

Sample Input 1

 

kyoto
t
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值