当前位置:网站首页>loop word
loop word
2022-08-11 00:58:00 【51CTO】
If a word is obtained by a circular right shift, we call these words a type of circular word.For example: picture and turepic belong to the same kind of cyclic word.Now given n words, we need to count how many kinds of cyclic words there are in the n words.
Input description:
Input consists of n+1 lines:
The number of words in the first line is n (1 ≤ n ≤ 50)
The next n lines, each line has a word word[i], length length (1 ≤ length ≤ 50).Consists of lowercase letters
Output description:
Output the number of loop words
Example 1
Input
5
picture
turepic
icturep
word
ordw
output
2
example 2
input
4
goran
igor
domagoj
relja
output
4
explain
It doesn't have to contain two or more different words to be a cycle word!
边栏推荐
猜你喜欢
input输入框超出部分用省略号表示以及判断内容是否有超出(PC端)
C#-委托的详细用法
YOLOv5的Tricks | 【Trick13】YOLOv5的detect.py脚本的解析与简化
Kunpeng compilation and debugging and basic knowledge of native development tools
微信小程序自定义navigationBar
复制带随机指针的链表——LeetCode
Shell编程三剑客之sed
R language multiple linear regression, ARIMA analysis of the impact of different candidates in the United States on the economic GDP time series
WinForm(五)控件和它的成员
sed of the Three Musketeers of Shell Programming
随机推荐
容器技术真的是环境管理的救星吗?
Elastic scaling of construction resources
微信小程序自定义navigationBar
Exceptions and exception handling mechanisms
input输入框超出部分用省略号表示以及判断内容是否有超出(PC端)
YOLOv5的Tricks | 【Trick12】YOLOv5使用的数据增强方法汇总
Shell Text Three Musketeers Sed
16. Sum of the nearest three numbers
Sub-database sub-table ShardingSphere-JDBC notes arrangement
vim简单保存窗口标识
electron -autoUpdater 更新
构建检测,无规矩不成方圆
Difference Between Image Recognition and Semantic Segmentation
数据分析面试手册《统计篇》
word 设置标题前分页
@Autowired注入RedisCache报错空指针
ABP中的数据过滤器
Shell 文本三剑客 Sed
【爬虫】scrapy创建运行爬虫、解析页面(嵌套url)、自定义中间件(设置UserAgent和代理IP)、自定义管道(保存到mysql)
How engineers treat open source