Python checkio "Long Non Repeat"解决方案
来源:互联网 发布:发热丝绕线数据 编辑:程序博客网 时间:2024/06/01 14:44
def non_repeat(line): # your code here result = '' for i in range(len(line)): value = '' for j in range(i,len(line)): char = line[j] if char not in value: value += char if len(value) > len(result):result = value else: break return resultdef non_repeat(s): for l in range(len(s), 0, -1): for i in range(0, len(s) - l + 1): sub = s[i:i + l] if all(sub.count(c) == 1 for c in sub): return sub return ''
阅读全文
0 0
- Python checkio "Long Non Repeat"解决方案
- Python checkio Long Repeat解决方案
- Python checkio median解决方案
- Python checkio "Friends"解决方案
- Python checkio Monkey Typing解决方案
- Python checkio Pawn Brotherhood解决方案
- Python checkio First Word解决方案
- Python checkio Secret Message解决方案
- Python checkio Index Power解决方案
- Python checkio Digits Multiplication解决方案
- Python checkio Days Between解决方案
- Python checkio Cipher map解决方案
- Python checkio Boolean Algebra解决方案
- Python checkio "Ghosts age"解决方案
- Python checkio "Striped Words"解决方案
- Python checkio "Speech Module"解决方案
- Python checkio "Making Change"解决方案
- Python checkio "Building Base"解决方案
- HTML5移动开发的10大移动APP开发框架
- 结构体与byte数组转换/结构体内定长数组
- linux 僵尸进程
- NKOJ 2844 (APIO 2014)回文串(Manacher+后缀自动机+倍增/回文树)
- 从标准输入获取字符串并将换行符去掉-c语言实现
- Python checkio "Long Non Repeat"解决方案
- ffmpeg avfilter map解释
- 近七成金融平台下线“风险保证金”,“去刚兑”后未来怎么投
- JDBC调用存储过程
- Java中的4种安全沙箱机制之内置于Java虚拟机(及语言)的安全特性
- WebRTC学习之二:编译(Win10+VS2015)
- BZOJ3160:万径人踪灭 (FFT+Manacher)
- BitBlt()用法
- linux检测内存泄漏工具valgrind