671
来源:互联网 发布:linux安装tgz文件 编辑:程序博客网 时间:2024/06/06 15:00
2017.9.28
首先判断两个字符串的长度是不是相同。然后判断,字符串A两个进行拼接后,是不是包含着字符串B,就表示是不是循环单词了
public class Solution { /* * @param words: A list of words * @return: Return how many different rotate words */public int countRotateWords(List<String> words){int size = words.size();if(size <= 1){return size;}String []tmp = new String[size];int count = 0;for(String s : words){boolean flag = false;for(int i = 0; i <= count; i++){if(tmp[i] != null && tmp[i].length() == s.length()*2 && tmp[i].contains(s)){flag = true;break;}}if(flag == false){String add = s+s;tmp[count] = add;count++;}}return count;}}
阅读全文
0 0
- 671
- 671
- codeforces 671B
- codeforces 671B
- codeforces 671A
- Codeforces 671B 二分
- LintCode 671 循环单词
- Testinside 646-671考题下载
- 多项式【数据结构课设一枚,671原创】
- Codeforces 671A Recycling Bottles
- codeforces 671A Recycling Bottles
- codeoforces 671B Robin Hood
- CodeForces 671B Robin Hood
- cf 671B Robin Hood
- CodeForces 671A Recycling Bottles
- 转载于[671coder的专栏]
- TC SRM 671 Div2 500 BearDartsDiv2
- TC SRM 671 Div2 1000 BearDestroysDiv2
- Vue之axios
- 剑指offer——58.对称二叉树
- 通过自己编写的C语言程序获取lcm正常格式的初始化数据代码
- 人脸检测和识别及python实现系列(1)-- 环境配置和相关类库安装
- 牛客网--2016--美团奇数位丢失
- 671
- vue基础知识
- spring boot could not resolve placeholder in string value 问题解决方法
- 使用rdo配置answer.ini网桥,实现创建能与外网通信的网络
- Android开发之Tween(补间动画)
- Android 进程间通信 Messenger
- linux服务监测 自动启动
- SwitchHosts—hosts管理利器
- swift中的!和?作用